Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: general perl question

by zigster (Hermit)
on Apr 24, 2001 at 14:50 UTC ( [id://75012]=note: print w/replies, xml ) Need Help??


in reply to In-place editing of files (was: general perl question)

OK first as an aside if you want to do this on the command line look at -i and -p see perldoc perlrun -i means edit the file in place and -p means loop over all the lines in the file soo:
perl -pi '.orig' -e 's/SPONGE/WIBBLE/' FILE
Will do the search and replace SPONGE for WIBBLE on file FILE, write the changes back, while saving the original file as FILE.orig. See perlrun for more info.

UPDATE
Could you please try and name your nodes with care. General Perl question will not help someone else looking for the same answer as you. It is a good question but a more carefully worded question would have really increased the value of the node.
--

Zigster

Replies are listed 'Best First'.
Specific perl question, requiring a specific title (00001)
by frankus (Priest) on Apr 24, 2001 at 15:07 UTC

    Um I don't think this is being run from the command line, but a script the only flags you can't use in a script IIRC is -M and -m. The script finds all files ending in .bak and processes them.

    ++ for the node naming chastisement though. ;-)

    --
    
    Brother Frankus.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-24 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found