Hello abhikalrt53,
You need to close the filehandle before you can unlink the file:
... open my $fh, '<', $file or die "Cannot open file $file: $!"; my $headers = grep /^>/, <$fh>; close $fh or die "Cannot close file $file: $!"; if ($headers <= 3) { unlink ...
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^3: What's wrong in this code?
by Athanasius
in thread Whats wrong in this code?
by abhikalrt53
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |