print "BEFORE:LINE = $line,EXPR= $expr,NEW_EXPR= $n_expr\n"; $line =~ s/$expr/$n_expr/; print "AFTER:LINE = $line,EXPR= $expr,NEW_EXPR= $n_expr\n";