There is elegant, and there is correct.
If the arrayref has been blessed into another package you will run into trouble. In the general case, you should use the following:
my @arr = UNIVERSAL::isa($x,'ARRAY') ? @$x : ($x);• another intruder with the mooring in the heart of the Perl
In reply to Re: elegant array assignment
by grinder
in thread elegant array assignment
by lackita
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |