in reply to Re: null keys
in thread null keys
Are we talking empty string or undef here? They act differently, depending.
Normally they do, but we're talking about hash keys here. A hash key can only be a string, so any number, reference or undefined value is stringified. undef happens to stringify to the emtpy string, so $foo{+undef} and $foo{''} are the same thing.
2;0 juerd@ouranos:~$ perl -le'$foo{+undef} = "Hello, world!"; print $f +oo{""}' Hello, world!
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: null keys
by marvell (Pilgrim) on Jun 12, 2002 at 16:27 UTC | |
|
Re: Re: Re: null keys
by marvell (Pilgrim) on Jun 12, 2002 at 16:26 UTC | |
by Juerd (Abbot) on Jun 12, 2002 at 16:37 UTC | |
by Jenda (Abbot) on Jun 12, 2002 at 16:35 UTC |