Wagner, David --- Senior Programmer Analyst --- CFS wrote:

        You pass as a refernce as ni
        called_sub(\...@d);
Now when you update, you are updating @d and not a copy.

No need to use a reference for that:

perl -wle '

    sub inc{ ++$_ for @_ }

    my @x = 1 .. 5;

    inc @x;

    print "@x";
'
2 3 4 5 6

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to