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
scoping of @+/@- when used with tie() #6730
Comments
From tassilo.parseval@post.rwth-aachen.deCreated by tassilo.parseval@post.rwth-aachen.deHi, there is something very odd going on when trying to emulate #! /usr/bin/perl -w package Tie::Prematch; package main; tie my %pre, 'Tie::Prematch'; $foo = "foobar"; tie %-, 'Tie::Prematch'; According to my knowledge, @- and @+ should be dynamically scoped so it's $foo =~ s/.ob/tied(%pre)->FETCH($foo)/e; But they somehow loose them when doing $foo =~ s/.ob/$pre{ $foo }/; even though it should be functionally identical. It's even stranger: as the third example in the above shows, it works when This bug is present in at least 5.6.1, 5.8.0 and 5.8.1RC4. Tassilo Perl Info
|
From @rgstassilo.parseval@post.rwth-aachen.de (via RT) wrote:
No, the /e creates a scope. Add a /e to your 2nd example and it becomes |
From tassilo.parseval@post.rwth-aachen.deOn Fri, Aug 29, 2003 at 08:40:49AM +0200 Rafael Garcia-Suarez wrote:
I don't understand this. Why do I need this additional scope in the And secondly, why don't I need the /e when I use %- (for instance) as Adding an /e, if I may say that, is also highly strange. The right-hand $a{a} = "foo"; # these two will give the same results This is not something that would become obvious when reading about /e in Tassilo |
From nobull at cpan.orgOn Thu Aug 28 01:53:46 2003, vparseval wrote:
The problem here is that the Perl compiler sees the RHS of the s/// as At the optree level the difference is the inclusion or otherwise of the Since this is a compile time optimisation and the tied-ness of %pre Arguably this (c|sh)ould be documented in perlop and/or perltie. |
From nobull at cpan.orgOn Sat Aug 04 09:15:05 2007, nobull67 wrote:
perltie diff (to BUGS section) attached |
From nobull at cpan.org |
From @cpansproutThis is fixed in 5.18, most likely by bb933b9. -- Father Chrysostomos |
From [Unknown Contact. See original ticket]This is fixed in 5.18, most likely by bb933b9. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
From @cpansproutOn Wed Aug 07 00:51:55 2013, sprout wrote:
It still needs tests, though. I’d better re-open it.... -- Father Chrysostomos |
@cpansprout - Status changed from 'resolved' to 'open' |
From @cpansproutOn Mon Aug 19 18:41:23 2013, jkeenan wrote:
Probably t/re/subst.t. -- Father Chrysostomos |
From @dcollinsnTests added in 1994b21, closing. -- |
From [Unknown Contact. See original ticket]Tests added in 1994b21, closing. -- |
Migrated from rt.perl.org#23624 (status was 'open')
Searchable as RT23624$
The text was updated successfully, but these errors were encountered: