"Perlwannabe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Still having problem with unlink. My original problem began with deleting > files from a list. I seem to have fixed the problem reading the list but > the unlink does not work. > > Here is the test script that I am working from: > > my $file = 'listitems.txt'; > open my $fh, $file or die "Cannot open $file: $!"; > while($Line = <$fh>) { > chomp($Line); > my $del = "*$Line*.*"; > my $complete = "c:/testdir/$del"; > unlink glob $complete or die "unlink failed: $!"; > } >
Can you post more of the script? As it stands $fh is nothing. Normally I would open a filehandle like so: my $file = 'listitems.txt'; open(FH, "<" . $file) || die "Failed to open $file: $!"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]