Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Printing from a hash table

by Marshall (Canon)
on Jun 03, 2020 at 07:05 UTC ( [id://11117628]=note: print w/replies, xml ) Need Help??


in reply to Printing from a hash table

Some simple code:
use warnings; use strict; my %birthdays = ( Fred => 'June 1', Ray => 'May 31', Glenn => 'May 27', Bob => 'August 28', Jim => '', Paul => undef, ); foreach my $name ( sort keys %birthdays) { next unless defined $birthdays{$name}; #skip undef next if $birthdays{$name} eq ''; #skip blank print "$name $birthdays{$name}\n"; } __END__ Bob August 28 Fred June 1 Glenn May 27 Ray May 31

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11117628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found