6 # this would break the hash magic setup [perl #134193]
7 my ($ca, $c) = ( \@{^CAPTURE_ALL}, \@{^CAPTURE} );
12 '{^CAPTURE}' => \%{^CAPTURE},
13 '{^CAPTURE_ALL}' => \%{^CAPTURE_ALL},
19 ['plus3', zlonk => 1],
20 ['minus2', thwapp => 0, all => 1],
23 my $hash = $hashes{$name} = {};
24 isa_ok(tie(%$hash, 'Tie::Hash::NamedCapture', @$_),
25 'Tie::Hash::NamedCapture', "%$name");
28 is("abcdef" =~ /(?<foo>[ab])*(?<bar>c)(?<foo>d)(?<bar>[ef]*)/, 1,
31 foreach my $name (qw(+ {^CAPTURE} plus1 plus2 plus3)) {
32 my $hash = $hashes{$name};
33 is_deeply($hash, { foo => 'b', bar => 'c' }, "%$name is as expected");
36 foreach my $name (qw(- {^CAPTURE_ALL} minus1 minus2)) {
37 my $hash = $hashes{$name};
38 is_deeply($hash, { foo => [qw(b d)], bar => [qw(c ef)] },
39 "%$name is as expected");