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 # };
In reply to Re: undef'ing @arrays caveat
by lestrrat
in thread undef'ing @arrays caveat
by vladb
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |