John W. Krahn wrote:

Wiggins D'Anconia wrote:

So a Perlish way to do this,

my (@months) =
('jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec');
my ($mday, $mon, $year) = (localtime)[3,4,5];

my $date = sprintf('%02d-%3s-%04d', uc $mday, $months[$mon] , $year+1900);

^^^^^^^^ You are upper-casing the number in $mday instead of the month name in $months[$mon]. :-)

my $date = sprintf '%02d-%3s-%04d', $mday, uc $months[ $mon ], $year +
1900;

That's what I get for working in two different windows on a laptop, good catch....


http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to