in reply to [SOLVED]substitution using hash issue
#!/usr/bin/perl use warnings; use strict; print "Enter date: "; chomp(my $date = <STDIN>); my ($day, $month, $year) = split '/', $date; print "$day $month $year\n"; my $m; my %dates = map { $_, sprintf '%02d', ++$m } qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/; my $month_n = $dates{$month}; print "$day $month_n $year\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: substitution using hash issue
by jaffinito34 (Acolyte) on Nov 12, 2012 at 15:21 UTC | |
by choroba (Cardinal) on Nov 12, 2012 at 15:25 UTC | |
by jaffinito34 (Acolyte) on Nov 12, 2012 at 15:26 UTC |