"system" is calling a command from OS, and "rm" is a unix command, 
if you are using Windows, that doesn't work. Use unlink($filename) 
is a real cross platform command =)

if you want to use "system" to remove a file in windows, write it as 
system("del $filename"); or print `del $filename`

have a nice day =)

----- Original Message ----- 
From: "Randolph S. Kahle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 13, 2002 12:21 AM
Subject: How do I delete a file from Perl?


> I am writing my first perl program (copied from a magazine).
> 
> The only line that is not working is
> 
> system( rm -rf $file );
> 
> The error message is:
> 
> Can't call method "rm" with a package or object reference.
> 
> Any tips?
> 
> Thanks -- Randy
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to