in reply to Re: Masters of Loops and Filehandles
in thread Masters of Loops and Filehandles

roboticus - Thanks for your reply and the code. I will see if I can work this into my loop since I need to process several files this way. I have already succeeded in replacing the pattern at a given location within a loop but replacing it globally doesnt seem to work even using variations of the $Gibberish sed line included in your example. I did attach an example of my existing code in this thread if you care to review it below. Thanks Again - pbyfire

Replies are listed 'Best First'.
Re^3: Masters of Loops and Filehandles
by roboticus (Chancellor) on May 10, 2012 at 22:35 UTC

    pbyfire:

    You can slurp the entire file into a variable by localizing the $/ variable:

    { local $/; $Gibberish = <$FH>; }

    If you do that after the open, and before the binmode & seek, you should be able to do a global search & replace on the entire file. Then just put it in a loop...

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.