Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Find and Replace multiple values in a file.

by elef (Friar)
on Feb 08, 2011 at 13:28 UTC ( #886960=note: print w/ replies, xml ) Need Help??


in reply to Find and Replace multiple values in a file.

I'm no expert, but I'm pretty sure the commands in a normal perl script are executed sequentially. I.e. it's not possible for a command to start executing before the previous one completed, not without threading.
Try closing the OUT filehandle before you open the same file with a different handle. In my experience, perl will often only write (some of) the changes to disk when the filehandle is closed.
So, remove all those sleeps and go

# ... close IN; close OUT; open (IN2, "+<_G203.xml"); # etc.


Comment on Re: Find and Replace multiple values in a file.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (16)
As of 2014-09-02 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (29 votes), past polls