in reply to Problem with passing array in a sub

As previously stated, you are passing a reference, not a list.

It is also possible to conditionally dereference in your sub:

if (ref($_[0])) { @array = @{$_[0]}; }