> 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: $!";
Neither of these worked. I am beginning to think that there is something
wrong with ActivePerl and WinXP.
Try this. Make a sample text file named "testfile.txt" and put it in
directory "c:\testdir\"
then try this script...don't add anything like use File::glob and see if
it works:
my $test = ("c:\\testdir\\testfile.txt");
unlink glob ($test) || die "unlink failed: $!";
This simple little script does not delete testfile.txt from my machine. Why?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]