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;
> print "Date: $date\n";
>
> perldoc -f uc
> perldoc -f sprintf
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>