http://www.perlmonks.org?node_id=287160


in reply to Re: Re: Re: String Manupulation
in thread String Manupulation

You are generating temporary files with invalid names and ignoring the function return code of open(). You should not use the following code, but use one of the temporary filename creation methods available in CPAN modules (perhaps IO::File->new_tmpfile(), but there is probably a better one).
use strict; use warnings; my $localtime = scalar localtime; my $tmp = ".txt"; my $logfile = $localtime.$tmp; $logfile =~ tr/ /-/; open( OUTFILE, ">$logfile" ) or die "couldn't open $logfile\:$!\n"; print OUTFILE "Hello"; close(OUTFILE)