in reply to passing reference to subroutine

Two things. First, I think you want to empty an array. Do that by assigning it an empty list.

Second, your copy the values out of the reference into a new array and modifies the copy, not the original.


Improve your skills with Modern Perl: the free book.