Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: My First LinkedIn Article On Perl

by jwkrahn (Abbot)
on Jan 01, 2021 at 22:47 UTC ( [id://11126109]=note: print w/replies, xml ) Need Help??


in reply to My First LinkedIn Article On Perl

Hello pritesh_ugrankar.   From your article:

The qr function allows for the regex to be stored in a variable so one can simply mention s/$regex_1/$regex_2/ instead of typing out the regex between the / and /.

The second part of the substitution operator ($regex_2 in your example) is a string, not a regular expression.

And therefore:

2) By saying s/$regex2/$regex1/ one can simply reverse the replacement done earlier if the need ever presents itself.

That will probably not work.

Replies are listed 'Best First'.
Re^2: My First LinkedIn Article On Perl
by pritesh_ugrankar (Monk) on Jan 02, 2021 at 11:07 UTC

    Hi,

    You are right!! Thank you for pointing it out. I've edited the article accordingly. Thank you very much!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found