in reply to Sorting Data by Date

use sprintf to pad out the day and month to 2 digits.
perl -e "sprintf('%02d',1)"

updated

Replies are listed 'Best First'.
Re: Re: Sorting Data by Date (boo)
by lex2001 (Sexton) on Sep 07, 2001 at 23:01 UTC
    Can you explain what "printf('%02d', 1)" and how would I implement this code onto my list of data? I tried using is like this: $date = printf ("%02d", $start_date); it didn't work using the syntax you gave me.
      You're confusing printf, which prints, with sprintf, which doesn't print, but returns a string. Same arguments, different side-effects and return values.