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
In reply to Re: Printing from a hash table
by Marshall
in thread Printing from a hash table
by catfish1116
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |