Steve Grazzini wrote at Wed, 06 Aug 2003 23:38:00 -0400: > On Wed, Aug 06, 2003 at 11:49:20PM -0400, perlwannabe wrote: >> I have made the script as simple as possible and cannot get >> unlink to work. >> >> unlink ("c:\testdir\*030977*.*") || die "unlink failed: $!"; > > You'd need to expand the wildcards yourself: > > my $pat = 'c:\testdir\*030977*.*'; > foreach (glob($pat)) { > unlink or warn "Couldn't unlink '$_': $!"; > }
Or if you want to write it as a one liner, you can exploit that unlink also takes a list as its arguments: unlink glob "c:/testdir/*030977*.*" or die "No files unlinked: $!"; Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]