Jeff Westman wrote:
> 
> Hi,

Hello,

> I want to remove an empty file using the file handle and not a
> variable name or literal name referencing it.  Something like this:
> 
>      1  #!/bin/perl
>      2  use warnings;
>      3  use strict;
>      4  no strict 'subs';
>      5
>      6  open(F, "> abc") or die "cant create file: $!";
>      7  close(F) or die "cant close file: $!";
>      8
>      9  unlink(\*F) if -z (F);
> 
> But, in this case, I get an error:
> 
> $ runme.pl
> -z on closed filehandle F at ./x line 9.

unlink() requires the file name.  It won't work with the file handle.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to