in reply to Re: Passing arrays in subs
in thread Passing arrays in subs

That doesn't really fix anything. The lexically scoped array will be altered, but the original array, @hello, won't end up with those changes in the main scope. speedyshady needs to use a reference, like morgon and kennethk have already said.

Alternatively, your method could be used, but the new list would have to be returned.

Replies are listed 'Best First'.
Re^3: Passing arrays in subs
by ahmad (Hermit) on Jul 30, 2010 at 19:20 UTC

    That doesn't really fix anything. The lexically scoped array will be altered, but the original array, @hello

    I've never seen the OP message saying "The original array should be changed"

    I've seen him creating a new array, but having difficultly to get the other variables values correct.

    So while others assumed he want to change the original array, I assumed he wants to create a new one ... what's wrong with that ... and what's all that -- for?