in reply to my $1

Solution:
return diff("$1")."+".diff("$2")
The quotes create a copy of the value.

Replies are listed 'Best First'.
Re^2: my $1
by mltucker (Initiate) on Apr 23, 2009 at 21:20 UTC

    Hmm, unless I have a different bug than I thought I did, this isn't working for me.

    -Mark

      You're right. I still had this on the mind. It was posted only two hours before.

      Back to your problem. There isn't one if you don't use globals. Fix:

      if (my ($pre, $post) = m/(.+?)\+(.+)/) { return diff($pre)."+".diff($post); }

        Nice solution. Thanks! Time to do some perldoc sifting to sort this all out :-).

        -Mark