Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This previewed fine, the first time I tried to post it, but the preview erased the text box. :(

I would like to know how to use perl to create a range of date strings (similar to the following trivial shell command plus tests). Any ideas? Thanks.

$strdat = `date -d "$strdat 1 day" %Y%m%d`

Replies are listed 'Best First'.
Re: date strings
by Anonymous Monk on Mar 06, 2000 at 22:01 UTC

    Something like this: perl -ne 'BEGIN{$time=time}; print scalar localtime $time; $time+=86400' works right on the command prompt; everytime you hit enter it will show you a new date

    Adapt it to your script as you see fit; also, I dont know if there is any simpler way to do it

Re: date strings
by Anonymous Monk on Mar 07, 2000 at 06:12 UTC
    A GREAT START! Thanks.

    One question though: How do I avoid the daylight savings time bugaboo (when it runs between 2300 and 2400 in standard time or between 0000 and 0100 in summer time)? I would have no control over the when users run the script.

    Thanks, again.