"James E Keenan via RT" <perlbug-followup@perl.org> wrote on Sat, 29 Jun 2013 07:12:06 PDT: > > Make the C<h> (mnemonic I<hash>) flag work (that line with the C<m> > operator): > > my $fmt1 = '(?<y>\d\d\d\d)-(?<m>\d\d)-(?<d>\d\d)'; > my $fmt2 = '(?<m>\d\d)/(?<d>\d\d)/(?<y>\d\d\d\d)'; > my $fmt3 = '(?<d>\d\d)\.(?<m>\d\d)\.(?<y>\d\d\d\d)'; > > for my $d (qw(2006-10-21 15.01.2007 10/31/2005)) { > if (my (%date) = $d =~ m{$fmt1|$fmt2|$fmt3}h) { > while (my ($k,$v) = each %date) { > print "$k = $v\n"; > } > } > } > > Works the same as: > > if ($d =~ m{$fmt1|$fmt2|$fmt3}) { > my %date = %+; I am opposed. If it "works the same as", we don't need another way. It increases the cognitive load unnecessarily for no real gain. And I don’t want us to keep adding /mods. We have to think of another way, something that embeds them and isn't stuck at mysterioius one-letter identifiers. --tomThread Previous | Thread Next