…d„^…d wrote:
> Hi~ everyone.
>
> While I'm writing a "for( ; ; ;)" sentence,I wrote "," instead of
> ";" by mistake.Actually the script really runs,but just has 3
> repetition.It's so funny.Could anyone explain this?
for (; ; ;) is just a special case of for (). for () iterates over the
list supplied - passing each item in the list to the block in $_. So
3 items in the list would get you 3 iterations.
for (1, 2, 3) {
print "$_\n";
}
should print :
1
2
3
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs