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

Re: key/value hash and index/valuse array slices syntax

Thread Previous | Thread Next
From:
Lukas Mai
Date:
June 10, 2013 21:59
Subject:
Re: key/value hash and index/valuse array slices syntax
Message ID:
51B64C47.4040103@gmail.com
On 10.06.2013 23:54, Eric Brine wrote:
> oops, I didn't notice you switched from m// to qr//.
>
> But qr// does something useful too, contrary to what you said. I've seen
> hashes keyed by regex patterns.
>
> $hash{$re} = [ /$re/ ];

That's still available via explicit stringification: $hash{"$re"} or 
$hash{"" . $re}. But yes, it's an incompatibility.


-- 
Lukas Mai <plokinom@gmail.com>

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