in reply to Re^5: Syntax for casting map to a hash or an array
in thread Syntax for casting map to a hash or an array
Wait, what part works, but for not the same reason?
These two work for exactly the same reason.
say Dumper({map { $_ => 'fish' } qw(one two red blue)}); say Dumper([map { $_ => 'fish' } qw(one two red blue)]);
These two work but NOT for the same reason, because there's an extra layer of ref->hash->ref going on?
That's the difference you're talking about, right?
say Dumper(\@{ {map { $_ => 'fish' } qw(one two red blue)} } ); say Dumper({map { $_ => 'fish' } qw(one two red blue)});
Thanks,
cbeckley
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Syntax for casting map to a hash or an array
by shmem (Chancellor) on Apr 05, 2017 at 19:07 UTC | |
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 |