in reply to null keys
First, there is no such thing as a "null" value in Perl. Perhaps you mean an undefined value, or perhaps you mean an empty string. If you try to use an undefined value as a hash key, Perl will act as if you tried to use an empty string. Because that's what Perl does with undefined values being used as strings.
I am not sure whether you realize what the syntax &$hash{$params->{action}}->() means. First of all, it's a syntax error, the right syntax would be &{$hash{$params->{action}}}->(). But that assumes $hash{$params->{action}} stores a code reference, whose return value is another code reference.
As for pushing things to arrays, any scalar or list value can be pushed to an array. Including undefined values and empty strings.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: null keys
by hakkr (Chaplain) on Jun 13, 2002 at 08:48 UTC | |
by Abigail-II (Bishop) on Jun 13, 2002 at 09:03 UTC |