Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Printing from a hash table

by Tux (Canon)
on Jun 03, 2020 at 08:11 UTC ( [id://11117630]=note: print w/replies, xml ) Need Help??


in reply to Printing from a hash table

As 0 is most likely an invalid/undefined birthday too, you just want "true" values. All good advice already given, the shortest route might be:

printf "%-12s %s\n", $_, $birthdays{$_} for grep { $birthdays{$_} } so +rt keys %birthdays;

-->

$ perl test.pl Name Birthday ------------------------- Bob August 28 Fred June 1 Glenn May 27 Ray May 31

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-19 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found