Glenn Cannon wrote:
>
> I am trying to force the current year to be show as a two digit
> number, with leading zero if necessary.
> Here is what I am using currently, what am I doing wrong?
You don't need the if .. else logic at all.
> #Code On
>
> @now = localtime;
> if (length($now[5] % 100) == l)
> {
> $year = sprintf("%02d", $now[5] % 100)
> }
> else
> {
> $year = $now[5] % 100
> }
my $year = sprintf '%02d', (localtime)[5] % 100;
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]