[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [ID 20000125.010] Globref locally assigned to glob in method doesn't work
If you change your call from
my $o = Mod->new(FH => \*TF);
to
my $o = Mod->new(\*TF);
it works fine. It also works fine if you make it
my $o = Mod->new(*TF);
I don't know why
*X = *FH
and
*X = \*FH
are the same, although I do know why
*X = "FH"
is the same, because it actually means *X = *{"FH"}. Apparently,
*X = \*FH really means *X = *{ \*FH }. I'd say this breaks the
no implicit dereffing rule, but with stars, all bets are off.
Also, you wouldn't need the local *FH if you just called
readline($self->{FH});
since readline() is a proper function not subject to the
sillinesses stopping < $self->{FH} > from working.
But I don't know if readline got fixed yet so it accepts
other than *FH. It should also accept anything <> does,
like FH and \*FH.
--tom
- References to:
-
mjd@plover.com
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]