Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Corrector

by hossman (Prior)
on Dec 02, 2008 at 16:57 UTC ( #727461=note: print w/replies, xml ) Need Help??

in reply to Corrector

May i humbly suggest an alternative...

#!/usr/bin/perl -pi s/this/that/; # substitutes this with that s/one/two/; # substitutes one with two

Run with: C:\filestochange

It doesn't have some of the interesting side effects of the original script, but i consider that a good thing.

Updated: there is no "i" in team, but there should have been one on the first line

Replies are listed 'Best First'.
Re^2: Corrector
by jdporter (Canon) on Dec 02, 2008 at 18:28 UTC
    #!/usr/bin/perl -p s/this/that/; # substitutes this with that s/one/two/; # substitutes one with two

    It also doesn't work. Did you even try it?

      Nope, didn't give it any thought at all. should be fixed now.

        Ok, the perl program is now correct... but your calling protocol is still junk. I believe you're going to end up with a solution which is a convoluted mixture of perl and "shell", or else do globbing inside the perl program, not unlike what the OP did. Of course, it wouldn't be nearly so much of a problem on an operating system with a Real Shell... ;-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://727461]
[GotToBTru]: ah yes that infamous poison di-hydrogen oxide
[Corion]: :-D
[Corion]: Di-hydrogen monoxide is even worse!
choroba needs some CH3CH2OH

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2016-12-06 12:49 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (103 votes). Check out past polls.