my @arr = ref( $x ) eq 'ARRAY' ? @$x : ( $x ); [download]
In reply to elegant array assignment by lackita