in reply to
elegant array assignment
I think that the only way to cope with all the special cases (blessed references, objetcs with @{} overloaded, etc.) is to just try to unreference the scalar and recover when it fails:
my @arr = eval { @$x }; @arr = ($x) if $@;
[download]
Comment on
Re: elegant array assignment
Download
Code
In Section
Seekers of Perl Wisdom