in reply to Re^6: Syntax for casting map to a hash or an array
in thread Syntax for casting map to a hash or an array
The first two work. In the upper, an anoymous hash is constructed with map's output, in the lower, an anonymous array. In each case, Dumper just get's passed the reference and dereferences it.
These two work but NOT for the same reason, because there's an extra layer of ref->hash->ref going on?
say Dumper(\@{ {map { $_ => 'fish' } qw(one two red blue)} } );
This one doesn't work, because the code is trying to dereference the anonymous hash as an array (@{ }).
The next one is just like the upper one from the former code block.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Syntax for casting map to a hash or an array
by cbeckley (Curate) on Apr 05, 2017 at 19:14 UTC | |
by shmem (Chancellor) on Apr 05, 2017 at 19:28 UTC | |
by stevieb (Canon) on Apr 05, 2017 at 19:30 UTC |