In order to catch the error, you need to change the code that loads the values. Instead of $hash{$key} = $value you might use$hash{entry} = "will get lost"; $hash{entry} = "this will replace it"; print $hash{entry};
See also perldata, or even perldsc on how to store several values at the same key.die "Error: duplicate value for $key\n" if exists $hash{$key}; $hash{$key} = $value;
In reply to Re: eval question
by choroba
in thread eval question
by jhuijsing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |