Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 rifling through the Monastery: (17)
As of 2015-07-31 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls