At 15:33 24.06.2001 -0500, Tim Grossner wrote:
>I want to open a file:
>
>open (CONFIG, ">/tftpboot/$_");
>chmod (0777, "/tftpboot/$_");
>
>but i want to make the filename be $_."the current date"
>
>the localtime function doesnt look very promising, as the output is not
>very human readable :-)
>
Hey Tim,
Sunday, June 24, 2001, 4:33:31 PM, you wrote:
TG> but i want to make the filename be $_."the current date"
TG> the localtime function doesnt look very promising, as the output is not
TG> very human readable :-)
I use localtime(time); all the time for this type of thing. here is
the c
Jos --
This seem to work. Also check perldoc -f localtime for all the sorid
details.
Dave
#!/usr/local/bin/perl -w
use Carp;
use POSIX qw(strftime);
$now_string = strftime "%Y%m%d", localtime;
chomp($now_string);
open (CONFIG,">$now_string");
print CONFIG "Today to is: $now_string\n";
close (C
well, there's also the 'time' operator...
but it all depends on what format you want/need
of course, there's the Date::Format module on cpan taht probably can format
it anyway you like
look at it here:
http://search.cpan.org/search?mode=module&query=date%3A%3Aformat
hth,
Jos Boumans
- Origi