Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: modifying the search pattern of a file.

by splinky (Hermit)
on Jul 13, 2000 at 21:58 UTC ( [id://22423]=note: print w/replies, xml ) Need Help??


in reply to modifying the search pattern of a file.

Just have to throw in a one-liner here, since there are command-line switches for this very thing.

perl -i -pe 's/(<% INCLUDE file)(1|2)(\.txt %>)/$1 . ($2 == 1 ? 2 : 1) + . $3/eg' index.txt

*Woof*

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found