Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: replacing equal to operator

by BillKSmith (Prior)
on Jan 28, 2021 at 20:49 UTC ( #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 (Canon) 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
Node Status?
node history
Node Type: note [id://11127602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2021-04-10 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?