in reply to undef'ing @arrays caveat
The trick here is that setting @array to undef doesn't really destroy or 'undefine' that array variable.
When you think about it though, why would an assignment undefine the value of an array? When you're doing assignment, you're doing exactly that: assignment ;)
But this following which your post inspired me to try out is, I gotta say, weird:
perl -MData::Dumper -e '%hash="foo"; print Dumper( \%hash )' # produces this... ( so far so good... ) # $VAR1 = { # 'foo' => undef # }; perl -MData::Dumper -e '%hash = undef; print Dumper( \%hash )' # produces: # $VAR1 = { # '' => undef # };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: undef'ing @arrays caveat
by particle (Vicar) on Apr 20, 2002 at 02:22 UTC | |
by lestrrat (Deacon) on Apr 20, 2002 at 03:25 UTC | |
by particle (Vicar) on Apr 20, 2002 at 13:02 UTC |