New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Globref locally assigned to glob in method doesn't work #1087
Comments
From @mjdominusI have a trivial module, Mod.pm. It has two methods. The constructor Here is file '/tmp/t1', my test script: ================================================================ ================================================================ Here is file '/tmp/Mod.pm', the module: ================================================================ package Mod; sub new { sub readit { 1; ================================================================ When I run the program /tmp/t1, I expect it to print out use Mod; instead, it prints nothing. Perl Info
|
From @mjdominus
Gee, that was pretty stupid. There really is a bug somewhere, but this doesn't demonstrate it. I'll try again in the morning. |
From [Unknown Contact. See original ticket]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 are the same, although I do know why *X = "FH" is the same, because it actually means *X = *{"FH"}. Apparently, 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 But I don't know if readline got fixed yet so it accepts --tom |
@rspier - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#2040 (status was 'resolved')
Searchable as RT2040$
The text was updated successfully, but these errors were encountered: