in reply to Re: elegant array assignment
in thread elegant array assignment

It's not clear to me that the OP wants to treat a blessed array reference as an array reference and not as an object.

There was a discussion of this kind of thing recently...um...here. The conclusion seemed to be that if you really want to assess arrayref-ness, wrap a dereference in an eval.

if ( ! eval { @$x; 1 } ) { # not array ref (ish) } else { # can be used as array reference! }

This will detect objects that have used overload to pretend to be an arrayref as well as any real arrayref that's been blessed. It also won't fall for any random reference that some joker did "bless $x, 'ARRAY'" on.

Here again, however, I can't tell that this is what the OP wanted to find out.