in reply to Have perl replace a bunch of text in lots of files

Please remove the "div" tags from your node.

One way to create an array of files names is to use glob

use warnings; use strict; for my $filename (glob '*.txt') { open my $fh, '<', $filename or die "can not open $filename: $!\n"; while (<$fh>) { # your code } close $fh; }

Replies are listed 'Best First'.
Re^2: Have perl replace a bunch of text in lots of files
by cheako (Beadle) on Mar 04, 2015 at 20:23 UTC
    Sorry for the Blasphemy, don't know what I was thinking.
      Has "use common::sense;" not caught on in the Monastery?

      How is that relevant to what toolic wrote?

      Besides, whether or not common::sense makes sense is subjective, as the module's documentation admits. It doesn't turn on use strict 'refs';!