In this case, it wont really matter. Since 1 and "1" is essentially the same.
If you were actually using a signed integer (in decimal), then you would see
the difference:
>From perldoc -f sprintf:
%s a string
%d a signed integer, in decimal
[root@fluffhead /]# perl -e 'printf "%04s\n", 12.5'
12.5
[root@fluffhead /]# perl -e 'printf "%04d\n", 12.5'
0012
But, go back to what is basically a string (integer in string context??):
[root@fluffhead /]# perl -e 'printf "%04d\n", 12'
0012
[root@fluffhead /]# perl -e 'printf "%04s\n", 12'
0012
So, why her snippet suddenly freaked out, I don't know. We didn't actually see
what created the $year, $month and $day *shrug*
Cheers,
Kevin
On Tue, Apr 24, 2001 at 11:40:23AM -0500, John Joseph Trammell
([EMAIL PROTECTED]) spew-ed forth:
> [snip]
>
> Well I'll be damned.
>
> [ ~ ] perl -e 'printf "%04s\n", 1'
> 0001
> [ ~ ] perl -e 'printf "%04s\n", "1"'
> 0001
> [ ~ ] perl -e 'printf "%04s\n", " 1"'
> 1
> [ ~ ] perl -e 'printf "%04s\n", " 1"'
> 0 1
> [ ~ ]
>
> And here I thought I knew it all. :-)
--
"This Too Shall Pass"
-- inscription on the inside of King Solomon's Ring.