Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: perl -i -pe ... with eof() testing

by hsinclai (Deacon)
on Feb 08, 2011 at 20:01 UTC ( [id://887043]=note: print w/replies, xml ) Need Help??


in reply to perl -i -pe ... with eof() testing

As an alternate approach you could craft a one-liner using Config::Simple , that module has most of what you want I think.

Replies are listed 'Best First'.
Re^2: perl -i -pe ... with eof() testing
by Anonyrnous Monk (Hermit) on Feb 09, 2011 at 15:31 UTC

    Config::Simple is certainly a useful module in other contexts, and I'm generally all for using modules, if appropriate.  For the task at hand, however, it wouldn't really provide any benefits.

    For one, it doesn't properly parse the config format in question (no .ini or similar, but some custom format for an ancient Fortran program), so using a regex substitution is much easier here.

    Also, it wouldn't free me from checking for the existence of the respective option in all of the configs, and using a corresponding flag variable, etc.

    Finally, it's not a core module, and installing it on every host the fixup script is supposed to run on would only create unnecessary administrative overhead...  But thanks for the response anyway.

      >> it doesn't properly parse the config format in question
      You are right, it doesn't handle your particular format .. suggestion retracted!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found