You've not explained what you plan to alter in each file.

cheako@hades:~$ diff -u <(curl 'http://www.perlmonks.org/?abspart=1;di +splaytype=displaycode;node_id=1118669;part=1') <(curl 'http://www.per +lmonks.org/?abspart=1;displaytype=displaycode;node_id=1118669;part=2' +) --- /dev/fd/63 2015-03-04 14:06:27.032424647 -0600 +++ /dev/fd/62 2015-03-04 14:06:27.032424647 -0600 @@ -1,6 +1,4 @@ - -get system status: - +HOSTNAME # get system status Version: FortiGate-60D v5.0,build4459,140410 (GA) Virus-DB: 23.00950(2015-03-02 19:54) Extended DB: 23.00950(2015-03-02 19:53) @@ -24,4 +22,5 @@ Release Version Information: GA System time: Tue Mar 3 12:38:43 2015 --------------------------------------------------------------: +#HOSTNAME -----------------------------------: +

As for the simple part: rename
On UNIX like systems it does not matter if you are working with the file or not, I'm not sure if this was ever fixed in Windows. For portable code you can maintain a hash of files you will rename and process them all at the end.

As suggested, don't SLURP unless you have too.


In reply to Re: Have perl replace a bunch of text in lots of files by cheako
in thread Have perl replace a bunch of text in lots of files by symgryph

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.