I don't know whether this is part of a larger script, but $refnum never gets set in this snippet, so you are storing your data in a hash entry with an empty key. That's why the entry with key '1' is undefinded undefined, triggering your die.
Perhaps in the while loop you meant:
$names{$ref}=$str;Update: stop inventing new verbs
CU
Robartes-
In reply to Re: hash problem
by robartes
in thread hash problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |