Hello
I have some perl code that was working and for the life of me I
cannot determine why it is is failing now. All I am trying to do is
to create and open a new file using a date time stamp in the
filename. Below is the code snippet for the open, It is returning an
invalid argument error.
($Seconds,$Minutes,$Hours,$Day,$Month,$Year) = (localtime)[0,1,2,3,4,5];
$Year = $Year + 1900;
$Date = $Month."-".$Day."-".$Year.".".$Hours.":".$Minutes.":".$Seconds;
$DuplicateFileName = ">Duplicate_File_List_".$Date;
print $DuplicateFileName."\n";
$OpenStatus = 1;
open DUPLICATE_FILE_NAME, $DuplicateFileName or $OpenStatus = 0;
if ($OpenStatus == 0)
{
print "$!";
print " ";
die "Unable to open duplicate file name file\n";
}
Thanks
Andrew
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/