This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Call get-magic once for defined ${...}
authorFather Chrysostomos <sprout@cpan.org>
Wed, 24 Aug 2011 01:15:48 +0000 (18:15 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 24 Aug 2011 03:06:26 +0000 (20:06 -0700)
commitad6acfc4a201a192b47f1290ac6238bb64ec92ee
tree484b27d233873643a44fbae8e9aeda49f3edff61
parente4787c0c2a0ba73363e536994429000307f03526
Call get-magic once for defined ${...}

This example:

sub TIESCALAR { bless[]}
sub FETCH { warn "fetching"; "\cTAINT" }
tie my $a, "";
defined $$a;

prints ‘fetching’ three times in 5.8.8, five times (!) in 5.10-12,
four times in 5.14, and three times in blead as of ed996e63f6.  Now it
only happens once.

It was commit 7a5fd60d4c that increased the number of fetches in 5.10,
but I haven’t checked which commits reduced it in 5.14.
pp.c
t/op/tie_fetch_count.t