I don't know, I guess 1 is a return of "true" signal.
However, for your purpose, use sprintf will solve your
problem.
Rgds,
Connie
----- Original Message -----
From: "Zachary Buckholz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 07, 2002 2:19 PM
Subject: number 1 showing up in printf output I don't understand
> Odd extra '1' showing up? Can someone explain this.
>
> #!/usr/local/bin/perl -w
> my $current_date = getdate();
> print "$current_date\n";
> exit();
> sub getdate {
> my ($day, $month, $year) = (localtime)[3,4,5];
> my $current_date = printf("%04d-%02d-%02d", $year+1900, $month+1, $day);
> return($current_date);
> }
>
>
>
> This is the output:
> [server]# ./weeklyreport.pl
> 2002-07-061
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]