# New Ticket Created by Hauke D # Please include the string: [perl #134193] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=134193 > Hi all, As reported by vr on PerlMonks (https://www.perlmonks.org/?node_id=11101258), accessing @{^CAPTURE} before %{^CAPTURE} causes the latter to become an empty, untied hash. $ perl -MData::Dumper -e '"a"=~/(?<X>a)/; print Dumper \%{^CAPTURE}, \@{^CAPTURE}, tied(%{^CAPTURE})' $VAR1 = { 'X' => 'a' }; $VAR2 = [ 'a' ]; $VAR3 = bless( do{\(my $o = 256)}, 'Tie::Hash::NamedCapture' ); $ perl -MData::Dumper -e '"a"=~/(?<X>a)/; print Dumper \@{^CAPTURE}, \%{^CAPTURE}, tied(%{^CAPTURE})' $VAR1 = [ 'a' ]; $VAR2 = {}; $VAR3 = undef; $ perl -v This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux ... The output I would expect from the second example is: $VAR1 = [ 'a' ]; $VAR2 = { 'X' => 'a' }; $VAR3 = bless( do{\(my $o = 256)}, 'Tie::Hash::NamedCapture' ); Thanks, Regards, -- Hauke DThread Previous