http://qs321.pair.com?node_id=11127602


in reply to Re: replacing equal to operator
in thread replacing equal to operator

You need "=" in substitution field. Replace "\1" with "$1" per warnings.
use strict; use warnings; use Test::Simple tests=>1; my $input_string = qq(parameter=TO_DATE('1900-01-01','YYYY-MM-DD')\n); my $desired_output = qq(parameter="TO_DATE('1900-01-01','YYYY-MM-DD')" +\n); my $output = $input_string =~ s/=(.*)/="$1"/r; ok( $output eq $desired_output, $output );

OUTPUT:

1..1 ok 1 - parameter="TO_DATE('1900-01-01','YYYY-MM-DD')" #
Bill

Replies are listed 'Best First'.
Re^3: replacing equal to operator
by jdporter (Paladin) on Jan 29, 2021 at 16:17 UTC
    You need "=" in substitution field.

    And I had it. What's your point?

      OOPS, Perhaps I need new glasses!
      Bill