Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: general perl question

by zigster (Hermit)
on Apr 24, 2001 at 14:50 UTC ( #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? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2022-01-26 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?