in reply to Printing from a hash table
use strict; use warnings; my %birthdays = ( Fred => 'June 1', Ray => 'May 31', Glenn => 'May 27', Bob => 'August 28', Jim => '', Paul => undef, ); while (my ($name, $B_day) = each %birthdays) { next if !defined $B_day or $B_day eq ''; printf "%9s : %-9s\n", $name, $B_day; }
Output:>/
Glenn : May 27 Fred : June 1 Ray : May 31 Bob : August 28
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Printing from a hash table
by perlfan (Parson) on Jun 03, 2020 at 04:20 UTC |