Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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?
[jedikaiti]: Shiney!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-06-22 15:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (523 votes). Check out past polls.