note
LeeC79
Remember, I'm new. Be gentle. I'm simply trying to create a log file that will have the current date and timestamp as the filename. But I can't figure out what is wrong with my code. The only thing I can think of is that the filename I'm trying to use is to long.
<CODE>
#!/usr/local/bin/perl -w
use strict;
my $localtime = scalar localtime;
my $tmp = ".txt";
my $logfile = $localtime.$tmp;
$logfile =~ tr/ /-/;
open( OUTFILE, ">$logfile" );
print OUTFILE "Hello";
close(OUTFILE);
</CODE>
And this is the error I get when trying to run:
<BR>
print() on closed filehandle OUTFILE at log.pl line 12.
<BR>
Any hints?
287095
287104