[root@localhost 001]# cat for.plx
#!/usr/bin/perl -w
print "The Begin!\n";
for ( $a=0; $a<10; $a++ ) {
print "a is now $a \n";
}
$i=10;
for ( ; $i>-1; ) {
print "$i..\n";
$i--;
}
print "The End!\n"
Output
[root@localhost 001]# perl for.plx
The Begin!
0--1--2--3--4--5--6--7--8--9--10--
10..9..8..7..6..5..4..3..2..1..0..
The End!
阅读(1141) | 评论(0) | 转发(0) |