Assigning anonymous hash to a list

Abigail abigail at abigail.be
Tue Jul 30 20:42:22 BST 2013


On Tue, Jul 30, 2013 at 08:23:30PM +0100, Adrian Lai wrote:
> my ($a, $b) = 'x', 'y';
> say $b; # undef
> 
> my ($a, $b) = ('x', 'y');
> say $b; # y
> 
> I assume Perl interprets as (my ($a, $b) = 'x'), 'y'.
> 


You don't have to assume, you can ask Perl.


  $ perl -MO=Deparse,-p -e 'my ($a, $b) = "x", "y"'
  ((my($a, $b) = 'x'), '???');
  $


Abigail


More information about the london.pm mailing list