in reply to Re^3: Why does assignment change the result?
in thread Why does assignment change the result?

Looks good (++).

Update:Ignore the rest of this node - as johngg points out, below - this code is equivalent to his assignTo sub.

If you like, you could add what "Anon Monk" implied was possible:

sub Modify_param_array{ print qq{In Modify_param_array - change @_\n}; @_ = qw[New contents. The caller never sees this]; }

     "An undefined problem has an infinite number of solutions." - Robert A. Humphrey         "If you're not part of the solution, you're part of the precipitate." - Henry J. Tillman

Replies are listed 'Best First'.
Re^5: Why does assignment change the result?
by johngg (Canon) on May 24, 2007 at 16:13 UTC
    I think I've covered that one in &assignTo by doing @_ = @temp; but I've thought of another couple of variations. Here's a revised script

    and output

    Given more time I'd refactor to use an array of code refs. and test in a loop as the script is getting quite long but I'm rushing to get ready for a holiday so it'll have to stay as it is.

    Cheers,

    JohnGG