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

Re^3: find & replace a string in perl

by mertserger (Curate)
on Nov 25, 2010 at 10:10 UTC ( #873611=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     if( $line =~ s/\btest\b/^\#/ig ) {
                    print  "$line\n";
            }
    
  2. or download this
    
     if( $line =~ m/test/ ) {
                    $line = "#" . $line;
                    print  "$line\n";
            }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2022-06-29 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (96 votes). Check out past polls.

    Notices?