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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2014-11-23 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (128 votes), past polls