Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Clearing Array Values

by Parham (Friar)
on Feb 09, 2002 at 13:38 UTC ( #144350=note: print w/ replies, xml ) Need Help??

in reply to Clearing Array Values

this is a very iffy subject i couldn't find clear documentation on with examples. from the documentation i've read on undef(), doing this:
UPDATE on the following code

undef @array; #@array undefined undef $scalar; #$scalar will be undefined
will clear those datatypes.. whereas
@array[2] = undef; #pick element number to undefine $scalar = undef; #$scalar will exist, but with no value
would assign undefined values to the datatypes. The biggest use for this would be assigning $variables to some array elements.. ie:
($value1,undef,undef,$value2,$value3,undef) = @array;
(thank you crazyinsomniac)

Comment on Re: Clearing Array Values
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-11-25 00:14 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (666 votes), past polls