Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: evaluating $1 in a replace string

by Oaks (Novice)
on Jul 08, 2002 at 06:24 UTC ( #180099=note: print w/replies, xml ) Need Help??


in reply to Re: Re: evaluating $1 in a replace string
in thread evaluating $1 in a replace string

Triple sweetness! Now I understand. I think I'll use the following version, because it gives me the same end result (having a double-quoted replacement expression on the final evaluation) and allows me to use the replacement expression as it is given to me.
#!/usr/bin/perl -w use strict; my $find = 'proof(\S+)'; my $rpl = 'read$1'; my $text = 'proofing is proof it needed to be proofed'; if ($text =~ s/$find/"\"$rpl\""/ee) { print "1st replacement made:\n\t$text\n"; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2020-10-28 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (260 votes). Check out past polls.

    Notices?