in reply to Re: Re: Hashes: Deleting elements while iterating
in thread Hashes: Deleting elements while iterating
Put in a print statement in the "faulty" for-loop and you'll see immediately what goes wrong.
foreach $key (%index){ print "deleting $key\n"; # delete $index{$key} if ($key =~ /$test.+/); }
Hope this helps, -gjb-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Hashes: Deleting elements while iterating
by knexus (Hermit) on Sep 02, 2003 at 21:20 UTC |