http://www.perlmonks.org?node_id=997974


in reply to Re: problem with array of hashes
in thread problem with array of hashes

So does:

my ($value) = map { join('array of hashes', 41) } $VAR;

Update: added parentheses. Thanks McA.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^3: problem with array of hashes
by McA (Priest) on Oct 09, 2012 at 11:17 UTC

    Oh, oh, oh

    Guys, look at this:

    use strict; use warnings; use Test::More tests => 2; my $the_ultimate_answer = 42; my $VAR1 = [ { '201' => 'i', '101' => 'f', '41' => 't', } ]; is(+(sort { $a <=> $b } keys %{ $VAR1->[0] })[0], $the_ultimate_answer +, 'Testing for ultimate answer'); my $value = map { join('array of hashes', 41) } $VAR1; is($value, $the_ultimate_answer, 'Testing for ultimate answer');

    The second proposal is more wrong than I expected. ;-)

Re^3: problem with array of hashes
by wirito (Acolyte) on Oct 10, 2012 at 13:03 UTC