in reply to Have perl replace a bunch of text in lots of files
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 | |
by Anonymous Monk on Mar 04, 2015 at 20:45 UTC |