Note that (like the flipflop operator) each seperate instance of <pattern> appears to keep its own internal state.print scalar <tt?>, "\n" for 1..3; # prints tt1, tt2 and tt3
And to drive the point home, fun with closures:print scalar <tt?>, "\n"; print scalar <tt?>, "\n"; print scalar <tt?>, "\n"; # prints tt1, tt1, tt1
my $s = sub { return scalar <tt?>; }; print $s->(), "\n"; print $s->(), "\n"; print $s->(), "\n"; # prints tt1, tt2, tt3
In reply to Re^2: process array with while loop
by jbert
in thread process array with while loop
by reason2006
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |