The double-curlies are necessary - with single-curlies the interpreter whines and dies. If anyone can explain why, I'd be interested.my @merged = values %{{ map {$_ => $_ } @array1,@array2 }} ;
andy.
In reply to one-liner to merge arrays (Re: A C-like brain in a Perl-like world)
by andye
in thread A C-like brain in a Perl-like world
by cyberscribe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |