foreach $file (glob("/path/to/files/*.dat"), glob("/path/to/files/*.p1")){ unlink($file) || die "cannot unlink file $file: $!"; }
> -----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>; > > Another way: > > unlink glob(".dat"); > unlink glob(".p1"); > > I have thought of popping out to the operating system as > well, and deleting > files as well, but would rather stay in Perl. > > Any help would be greatly appreciated.. > > Thank You, > Mike > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]