On 9/5/05, Dintelmann, Peter <[EMAIL PROTECTED]> wrote:
> When a subroutine _ is defined it may "mask" the _ handle used
> by file test operators.
> 
>     #!/opt/perl32/bin/perl
> 
>     use strict;
>     use warnings;
> 
>     sub _ { "/etc/hosts" }
> 
>     open my $f, "/dev/null" or warn $!;
>     stat $f or warn $!;
> 
>     print "size: ", -s _, "\n";
> 
> In the last line sub _ is invoked and the script prints the size
> of "/etc/hosts" instead of 0.
> 
> However "-X *_" seems to get this right. Should we mention this in
> perlfunc?

I don't think so, since this behaviour is the same with any other identifier.

Reply via email to