in reply to Printing based on values?
use warnings; use strict; my %age = ( years => 5, months => 0, weeks => 2, days => 0, ); for (sort keys %age) { print "$_ = $age{$_}\n" if $age{$_}; } __END__ weeks = 2 years = 5
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing based on values?
by Douglas0028 (Novice) on Mar 26, 2011 at 23:46 UTC | |
by toolic (Bishop) on Mar 26, 2011 at 23:58 UTC | |
by Douglas0028 (Novice) on Mar 27, 2011 at 00:16 UTC | |
by toolic (Bishop) on Mar 27, 2011 at 00:24 UTC |