On Tue Apr 02 07:36:23 2013, daxim wrote: > > This is a bug report for perl from daxim@cpan.org, > generated with the help of perlbug 1.39 running under perl 5.16.3. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > Example code adapted from perlretut. > > 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 = %+; > > Rationale: side effects are a weird-ass way to program in a language > that actually has operators/expressions/functions which are able to > return values. I'd like eventually to get rid of side effects, but > first there actually must be a way to do something without involving > action at a distance. If you can't see what's wrong with the code just > above, imagine you had do this to get the length of something: > > length($something); > # according to perlvar, $Ë is set to the last successful length > # measuring > print "something is $Ë long"; > # take care not to use an outdated $Ë or accidently overwrite > # it! :-o > This RT is a request for a new feature: a new regex modifier '/h'. Is there any support for development of this new feature? (I ask, in part, because it hasn't received a "second the motion" in the three months since the request was originally filed.) Is there anyone who wants to try to write an implementation for this new feature? Thank you very much. Jim Keenan --- via perlbug: queue: perl5 status: new https://rt.perl.org:443/rt3/Ticket/Display.html?id=117447Thread Previous | Thread Next