Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: using undef on a array

by Anarion (Hermit)
on Oct 31, 2001 at 15:00 UTC ( [id://122321]=note: print w/replies, xml ) Need Help??


in reply to Re: using undef on a array
in thread using undef on a array

The last one is easy to understand, but if i try to asing a undef value to $#a it is not modified:

perl -le 'use strict;my @a=("a");$#a=undef;print "Defined" if defined @a;print @a'
Defined
a

But whats the meaning of defined, what exactly do the undef @a,what exatly perl do? If i write $#a=-1 i'm clearing all and have no values, the both, 1 and 2 have no content, thats why it prints that they have 0 elements, buf one its undefined, but still avaliable, sorry if i dont understand what it means with defined, you say it still exists ... in both cases exists and are emptys.

$anarion=\$anarion;

s==q^QBY_^=,$_^=$[x7,print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://122321]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2025-07-20 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.