in reply to elegant array assignment
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: elegant array assignment
by kyle (Abbot) on Feb 15, 2008 at 22:48 UTC |