develooper Front page | perl.perl5.porters | Postings from July 2013

Re: [perl #117447] re modifier "h" - return named captures as hashexpression

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
July 1, 2013 10:38
Subject:
Re: [perl #117447] re modifier "h" - return named captures as hashexpression
Message ID:
20130701103706.GB2063@iabyn.com
On Sat, Jun 29, 2013 at 01:36:52PM -0600, Tom Christiansen wrote:
> > 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.

If there were such a modifier (and I agree that it should be "better" than
another 1-letter flag), I would prefer to see some new semantics, such
as returning a structured (i.e. nested) match object from a nested search
pattern (although I have no idea how the details would pan out).

-- 
Spock (or Data) is fired from his high-ranking position for not being able
to understand the most basic nuances of about one in three sentences that
anyone says to him.
    -- Things That Never Happen in "Star Trek" #19

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About