Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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?
[erix]: well, I hope you're right
[Your Mother]: Bill Clinton assaulted and raped repeatedly. Even when it was hinted and finally all but proved, no one cared because his sexism, and racism, and killing was decorous.
[Your Mother]: I think Trump might be better specifically because no one respects him so he won't get his way the way the others did.
[Your Mother]: (I certainly did not vote for him and have been an outspoken critic of his for three decades, by the by.)
[erix]: I'd like Russia threatened a bit more, flattered a bit less
[Your Mother]: The last two regimes killed a million, displaced 10 million, torture prisons, and ruined countries… somehow it's magically bad _now_.
[erix]: what/who are the last two regimes?
[Your Mother]: Bush/Obama. 15 straight years of warfare, torture, etc, etc.
[Your Mother]: All caused by the political fallout of Carter/Reagan when the Afghan chickens came home to roost on 9/11.
[Your Mother]: US foreign policy is toxic and like a broken record.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-01-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (173 votes). Check out past polls.