in reply to Re^6: Perl Internals - references and symbol table
in thread Perl Internals - references and symbol table
Using both fixes this problem but can still suffer if the iterative construct is exited prematurely.my @array = (1..12); while(my @els = elements @array, 3 ){ last if grep { $_ eq 2 } @els; } my @five = elements @array 5; # Would get (4,5,6,7,8)!DWIM
The later probably almost never occur in most code, but when it does, I'm sure it would take much head scratching before deciding where the problem lies.{ while (my @els = elements @giantarray, 10 ){ # Do stuff last if $els[0] == $somecondition; } redo if $someothercondition; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Perl Internals - references and symbol table
by Aristotle (Chancellor) on Nov 19, 2002 at 23:48 UTC | |
by shotgunefx (Parson) on Nov 20, 2002 at 04:17 UTC |