in reply to Re: evaluation strategy of perl
in thread evaluation strategy of perl
#!/usr/bin/perl -wT use strict; my (@d,$i,$j); # all vars in same scope for $i (1..3) { push @d, sub { print "$i\n" }; # same as line below } for ($j = 1; $j<=3; $j++) { push @d, sub { print "$j\n" }; # same as line above } $_->() for @d; # execute all anon subs __END__ 1 2 3 4 4 4
-Blake
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: evaluation strategy of perl
by Aristotle (Chancellor) on Sep 20, 2002 at 15:33 UTC |