On Tue, 29 Aug 2000 18:17:46 -0600, Tom Christiansen wrote:
>You could pass it as
>
> p(*FH);
>
>instead, and the function's definition doesn't change.
Typeglobs are on the endangered species list. That is part of the reason
for this RFC.
> sub getfh {
> return open(my $fh, "+< /dev/null") && $fh;
> }
Aha! You fell for one of my pet pieves. You tried to return a lexical in
the same expression were it was declared. That doesn't work. It's not
the same variable. Running it with warnings enabled says:
Name "main::fh" used only once: possible typo at test.pl line 3.
I feel that this ought to have worked, i.e. that the scope of the
lexical kicked in in the middle of the expression, at the transition
over the shortcut operator "&&".
--
Bart.
- Re: RFC 33 (v2) Eliminate barewo... Tom Christiansen
- Re: RFC 33 (v2) Eliminate barewo... Casey R. Tweten
- Re: RFC 33 (v2) Eliminate barewo... Peter Scott
- Re: RFC 33 (v2) Eliminate barewo... Gregory S Hayes
- Re: RFC 33 (v2) Eliminate barewo... Tom Christiansen
- Re: RFC 33 (v2) Eliminate barewo... Nathan Wiger
- Re: RFC 33 (v2) Eliminate barewo... Tom Christiansen
- Re: RFC 33 (v2) Eliminate barewo... Nathan Wiger
- Re: RFC 33 (v2) Eliminate bareword filehandles. Peter Scott
- ARGV vs $ARGV (was Re: RFC 33 (v2) Eliminate bare... Nathan Wiger
- Re: RFC 33 (v2) Eliminate bareword filehandles. Bart Lateur
- Re: RFC 33 (v2) Eliminate bareword filehandles. Tom Christiansen
- Re: RFC 33 (v2) Eliminate bareword filehandle... Bart Lateur
- Re: RFC 33 (v2) Eliminate bareword filehandles. Jonathan Scott Duff
- Re: RFC 33 (v2) Eliminate bareword filehandles. Piers Cawley
