Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Multiline search and replace in file(s)

by haukex (Archbishop)
on Aug 09, 2020 at 08:03 UTC ( [id://11120515]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
        print $ofh $data;
        close $ofh;
    }
    
  2. or download this
    use warnings;
    use strict;
    ...
            s/Marry Had A\nLittle Lamb\nShe Was GOOD\n/CHANGED!!!\n/smg;
        });
    }
    
  3. or download this
    perl -wMstrict -0777 -i -pe 's/Marry Had A\nLittle Lamb\nShe Was GOOD\
    +n/CHANGED!!!\n/smg' Test*_Copy
    
  4. or download this
    use warnings;
    use strict;
    ...
        print $outfh $data;
        $repl->finish;
    }
    
  5. or download this
    use warnings;
    use strict;
    ...
        print $fh $data;
        close $fh;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-03-28 16:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found