![]() |
|
more useful options | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
Actually, arrays cannot be undefined, just made empty (same with hashes). If you try undef @array in the debugger and then dump its value using the 'x' command, the effect is the same as if you had said @array = (), namely 'empty array'. (The same may be said for hashes, which under the above circumstances, produce the message, 'empty hash'). Only scalars may be truly undefined; undef is itself merely a value, albeit a special one. As a C/C++ programmer, I rather think of scalars analagous to pointers -- sort of "auto-allocating, auto-dereferencing, type-ambivalent pointers", but pointers nonetheless, with undef rather analagous to NULL. dmm If you GIVE a man a fish you feed him for a dayBut, TEACH him to fish and you feed him for a lifetime In reply to Re: Re: undef'ing @arrays caveat
by dmmiller2k
|
|