Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: replacing equal to operator

by BillKSmith (Monsignor)
on Jan 28, 2021 at 20:49 UTC ( [id://11127602]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-28 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found