Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Deleting undef values from a hash

by liz (Monsignor)
on Dec 14, 2003 at 00:29 UTC ( #314585=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %a = (foo => undef);
    print "existed = ".(() = delete $a{foo})."\n";
    ...
    __END__
    existed = 1
    notexisted = 1
    
  2. or download this
    my %a = (foo => 1, bar => 2, baz => 3);
    $" = ',';
    ...
    __END__
    existed = 1
    notexisted = ,2,3
    
  3. or download this
    use Devel::Size qw(size total_size);
    
    ...
    c: 16
    d: 16
    e: 29
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://314585]
Approved by Zaxo
Front-paged by Enlil
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2016-07-01 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (414 votes). Check out past polls.