in reply to How to empty an array ???
In perl, there typically never is a need to empty an array. If you limit the scope of your array to the loop block, you'll simply get a new empty array every time through the loop. Simple, effective, and very generically appliable.
for (1 .. 3) { my @flowers; # new, emtpy array, every time ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to empty an array ???
by Joost (Canon) on Nov 26, 2005 at 04:03 UTC |