in reply to Hashes: Deleting elements while iterating
foreach $key (%index){ delete $index{$key} if ($key =~ /$test.+/); }
Where the keyword "keys" returns a list of all the hash keys. The new version does not generate warnings.foreach (keys %index) { delete $index{$_} if /$test.+/ }
|
|---|