develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [ID 19991126.001] open(my $FH,..) emits false warning

From:
M.J.T. Guy
Date:
November 26, 1999 08:13
Subject:
Re: [ID 19991126.001] open(my $FH,..) emits false warning
Message ID:
E11rNzl-0007nC-00@taurus.cus.cam.ac.uk
Gurusamy Sarathy <gsar@ActiveState.com> wrote
> The run time lookup of the lexical's name in PL_comppad_name looks
> like the problem.  PL_comppad_name is not usually set to the executing
> sub's pad at run time.  It's value is valid only during compile time.

It's certainly specific to that use of a lexical.   Both of the
following work fine:

%perl -w
my $a;
open $a, '/etc/passwd' or die "open:$!\n";
print <$a>;
__END__

%perl -w
open $a, '/etc/passwd' or die "open:$!\n";
print <$a>;
__END__


Mike Guy



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About