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 | |
by BillKSmith (Monsignor) on Jan 29, 2021 at 20:41 UTC |
In Section
Seekers of Perl Wisdom