> 
> $filename = "data_logfile" .(localtime). ".txt"; open(LOG, 
> ">>$filename") || die "cannot append: $!";
> 
> 
> when I compile the file is says "Invalid argument". This is  
> because of the colon character.
> 

You have answered your own question :). You can't use the : char in the
creation of the file name, so why not just take them out?


($time = localtime) =~ s/:/_/g; 
$filename = "data_logfile " . $time . ".txt"; 
open(LOG, ">$filename") or die "cannot append: $!";
print LOG "foo";
close LOG;

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 9/10/2004
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to