in reply to modifying en passant

I'm convinced that you're upsetting the parser with the lvalue expression ($new1=$1), since =~ needs not just an lvalue but a scalar to operate on. Probably best to just use $new=~s/this/that/;

HTH,
SSF

Replies are listed 'Best First'.
Re^2: modifying en passant
by GrandFather (Saint) on Jan 09, 2010 at 22:47 UTC

    Allow me to convince you otherwise:

    use strict; use warnings; my $valueToKeep = 'wibble'; (my $editedValue = $valueToKeep) =~ s/w/W/g; print "Edited: $editedValue Original: $valueToKeep\n";

    Prints:

    Edited: Wibble Original: wibble

    True laziness is hard work