Stephen Toney has asked for the wisdom of the Perl Monks concerning the following question:
$value = $hashref->{$fieldnum};
is triggering the 2 errors
Argument "$/ 1l" isn't numeric in hash element Bad index while coercing array into hashThe program then halts.
The value "$/ 1l" is the correct $value for the $fieldnum key. In other words, both the key and the element are correct.
I don't understand the problem here. Elements need not be numeric. And why is Perl trying to use the element as an argument? And to what?
I thought it might be the $ which is the first data character, but the same line of code handles similar data OK before it gets to this one.
Many thanks for any insights!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Argument isn't numeric in hash element
by haoess (Curate) on Jun 09, 2004 at 15:17 UTC | |
|
Re: Argument isn't numeric in hash element
by artist (Parson) on Jun 09, 2004 at 14:24 UTC | |
|
Re: Argument isn't numeric in hash element
by hv (Prior) on Jun 09, 2004 at 16:32 UTC | |
by Stephen Toney (Sexton) on Jun 09, 2004 at 18:19 UTC |