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
Dave Mitchell
July 1, 2013 10:38
Re: [perl #117447] re modifier "h" - return named captures as hashexpression
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About