Re: Opening a file, but adding the date to the name

2001-06-25 Thread Aaron Craig
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 :-) >

Re: Opening a file, but adding the date to the name

2001-06-24 Thread Tim Musson
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

Re: Opening a file, but adding the date to the name

2001-06-24 Thread David J Jackson
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

Re: Opening a file, but adding the date to the name

2001-06-24 Thread Jos I. Boumans
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