On Jan 12, Randolph S. Kahle said:

>The only line that is not working is
>
>system( rm -rf $file );

You (or they) have forgotten the quotes:

  system("rm -rf $file");

But if you copied this from another source, that source was totally
unaware that deletion of files like THAT is TOTALLY unsafe.  A safer
approach is:

  system("rm", "-rf", $file);

But an even better approach is to not use system() at all -- Perl can
delete files natively, with the unlink() function:

  unlink $file;

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


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

Reply via email to