Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
XP is just a number
 
PerlMonks  

Re: (Challenge)(for new users) Replacing a text

by robharper (Pilgrim)
on Sep 24, 2004 at 07:01 UTC ( [id://393450]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to (Challenge)(for new users) Replacing a text

Well, I'm a newbie, so a rummage through perlrun (thanks for the hint) got me there. I'll hide this behind a readmore, just in case anyone else wants a go...

Update: not including the filename at the end, 37 chars

perl -pi -e 's/Will( Emigh)/JAPH\1/g' FileName

Replies are listed 'Best First'.
Re^2: (Challenge)(for new users) Replacing a text
by antirice (Priest) on Sep 24, 2004 at 14:00 UTC

    And with -w...

    # perl -wpi -e 's/Will( Emigh)/JAPH\1/g' FileName \1 better written as $1 at -e line 1. #

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://393450]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.