6 my %hashes = ('+' => \%+, '-' => \%-);
11 ['plus3', zlonk => 1],
12 ['minus2', thwapp => 0, all => 1],
15 my $hash = $hashes{$name} = {};
16 isa_ok(tie(%$hash, 'Tie::Hash::NamedCapture', @$_),
17 'Tie::Hash::NamedCapture', "%$name");
20 is("abcdef" =~ /(?<foo>[ab])*(?<bar>c)(?<foo>d)(?<bar>[ef]*)/, 1,
23 foreach my $name (qw(+ plus1 plus2 plus3)) {
24 my $hash = $hashes{$name};
25 is_deeply($hash, { foo => 'b', bar => 'c' }, "%$name is as expected");
28 foreach my $name (qw(- minus1 minus2)) {
29 my $hash = $hashes{$name};
30 is_deeply($hash, { foo => [qw(b d)], bar => [qw(c ef)] },
31 "%$name is as expected");