Skip to content
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

Perl 5.12: STORE/FETCH of tie()d hash get literal stringref key stringified #10824

Closed
p5pRT opened this issue Nov 14, 2010 · 5 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented Nov 14, 2010

Migrated from rt.perl.org#79178 (status was 'resolved')

Searchable as RT79178$

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2010

From polarcluster@gmail.com

# Perl 5.12​: STORE/FETCH of tie()d hash get literal stringref key
# stringified. This bug emerged in perl v5.12, prior perls are fine. It
# affects only literal stringref used as key for tie()d hash
# storing/fetching (the same stringref stored in variable works fine)...

tie %a, 'Foo';

$a{\'foo'} = undef; # 5.10.1 prints​: 'SCALAR'; 5.12.0 - 5.12.2 prints ''
$a{\'foo'}; # same

$stringref = \'foo';
$a{$stringref} = undef; # prints 'SCALAR'
$a{$stringref}; # prints 'SCALAR'

$a{\$scalar} = undef; # prints 'SCALAR'
$a{\$scalar}; # prints 'SCALAR'

package Foo;
sub TIEHASH { bless {}, $_[0] }
sub STORE { print ref $_[1] }
sub FETCH { print ref $_[1] }

@p5pRT
Copy link
Author

p5pRT commented Nov 27, 2010

From @cpansprout

Fixed by 04698ff.

@p5pRT
Copy link
Author

p5pRT commented Nov 27, 2010

@cpansprout - Status changed from 'new' to 'resolved'

@p5pRT p5pRT closed this as completed Nov 27, 2010
@p5pRT
Copy link
Author

p5pRT commented Aug 10, 2013

From @cpansprout

On Sat Nov 27 07​:16​:42 2010, sprout wrote​:

Fixed by 04698ff.

But that only fixed $hash{\"ref"}.

649c173 fixes $hash{+undef_constant}, which could arguably also belong
in this ticket.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Aug 10, 2013

From [Unknown Contact. See original ticket]

On Sat Nov 27 07​:16​:42 2010, sprout wrote​:

Fixed by 04698ff.

But that only fixed $hash{\"ref"}.

649c173 fixes $hash{+undef_constant}, which could arguably also belong
in this ticket.

--

Father Chrysostomos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant