in reply to Re: How to use use the days date to read a dir?
in thread How to use use the days date to read a dir?

my $date = strftime "%x", localtime; $date =~ tr#/#-#;

If you want a specific format, why don't you use that format instead of munging the "national representation of the date"? It doesn't even work (I get "2009-01-14").

Fix:

use POSIX qw( strftime ); my $date = strftime "%m-%d-%y", localtime; print "$date\n";

But since he didn't ask for the date, he'd want

my $dir = strftime "Results %m-%d-%y", localtime;

Replies are listed 'Best First'.
Re^3: How to use use the days date to read a dir?
by lomSpace (Scribe) on Jan 14, 2009 at 21:05 UTC
    That was very helpful! Thanks!