> -----Original Message-----
> From: Michael Pastore [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 8:48 AM
> To: [EMAIL PROTECTED]
> Subject: deleting files
> 
> 
> Hello All,
> 
> Just a quick question on deleting files in Perl.
> 
> I am trying to delete some files in a directory, but I do not 
> know their
> names...just ending extension...
> 
> I have tried:
> 
> 
> One way:
> 
> unlink <*.dat>;
> unlink <*.p1>;

These should work fine. perldoc -f unlink has an example just like
this. You have to be in the proper directory, or include the directory
in your pattern:

   unlink </path/to/files/*.dat>, </path/to/files/*.pl>;

> 
> Another way:
> 
> unlink glob(".dat");
> unlink glob(".p1");

These won't work, because you need *.dat and *.pl. This would only
remove files named exactly '.dat' and '.pl'

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

Reply via email to