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
UNIVERSAL::AUTOLOAD breaks named captures/%-/%+ #11781
Comments
From @maukeCreated by @mauke% perl -wle '{ package UNIVERSAL; sub AUTOLOAD { warn "$AUTOLOAD(@_)" } } "a" =~ /(?<X>.)/ or die; print "$+{X}"' % perl -wle '%- if 0; { package UNIVERSAL; sub AUTOLOAD { warn "$AUTOLOAD(@_)" } } "a" =~ /(?<X>.)/ or die; print "$+{X}"' So apparently just creating UNIVERSAL::AUTOLOAD is enough to break %+, even if As far as I can tell this is broken in 5.12 and 5.10 but works in 5.14, Any idea what's going on? Perl Info
|
From @jkeenanAdditional data points ... This is what I got on Linux for first 5.12.0, ### ### Similar results with these two Perl versions on Darwin. |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Wed Nov 30 13:39:47 2011, l.mai@web.de wrote:
Tie::Hash::NamedCapture::DESTROY(Tie::Hash::NamedCapture=SCALAR(0x823fba8))
Tie::Hash::NamedCapture::DESTROY(Tie::Hash::NamedCapture=SCALAR(0x823fca8))
It was indeed this commit that made the difference, but I cannot commit 8dcfe2e Move remaining Tie::Hash::NamedCapture XS code to NamedCapture.xs -- Father Chrysostomos |
From @cpansproutOn Wed Nov 30 17:49:48 2011, sprout wrote:
Tie::Hash::NamedCapture::DESTROY(Tie::Hash::NamedCapture=SCALAR(0x823fba8))
Tie::Hash::NamedCapture::DESTROY(Tie::Hash::NamedCapture=SCALAR(0x823fca8))
I’ve just figured it out. In gv.c: S_require_tie_mod(pTHX_ GV *gv, const char *varpv, SV* namesv, const PERL_ARGS_ASSERT_REQUIRE_TIE_MOD; if (!stash || !(gv_fetchmethod(stash, methpv))) { In gv.h: #define gv_fetchmethod(stash, name) gv_fetchmethod_autoload(stash, name, So, if either the stash does not exist (as in 5.14; in 5.12 parts of it That means the problem still persists in 5.14. You just have to mention S_require_tie_mod probably should not be autoloading. Errno and arybase have the same problem: $ ./perl -Ilib -le 'arybase::Googoo() if 0; { package UNIVERSAL; sub (should print b) $ ./perl -Ilib -le 'Errno::onrrE() if 0; { package UNIVERSAL; sub (should print 20, on Unix at least) -- Father Chrysostomos |
From @cpansproutOn Wed Nov 30 18:04:50 2011, sprout wrote:
Tie::Hash::NamedCapture::DESTROY(Tie::Hash::NamedCapture=SCALAR(0x823fba8))
Tie::Hash::NamedCapture::DESTROY(Tie::Hash::NamedCapture=SCALAR(0x823fca8))
Now fixed with commit 0ea0399. I hope my responses have given you Now, back to tending the COWs.... -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#105024 (status was 'resolved')
Searchable as RT105024$
The text was updated successfully, but these errors were encountered: