Jeff Tillotson wrote:
>
> I have been searching for a way to do this and have not had any luck.
>
> I am using localtime() to determine the day of the month.  I need to
> make sure the variable it returns will always be 2 digits and padded
> with zeros.  For example currently it is like:
> $var = (localtime)[3];
> $var would be 5.
>
> I would like $var to be 05 in that case.  However if it were 13 then
> $var would be 13.
>

Just for the sake of being different,

  my $var = substr ((localtime)[3] + 100, 1)

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to