z28 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; my @list = glob("/home/onyx2/www/*.shtml"); foreach my $file (@list) { open FILE, "$file" or die "open: $!"; for (<FILE>) { $_ =~ s%foo\-fuu\.net%fuuonline\.com%ig; print FILE $_; } close FILE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing each file of a directory to change once string instance to another
by rah (Monk) on Mar 21, 2002 at 03:56 UTC | |
|
Re: Parsing each file of a directory to change once string instance to another
by metadoktor (Hermit) on Mar 20, 2002 at 20:49 UTC | |
by z28 (Sexton) on Mar 20, 2002 at 22:02 UTC | |
|
Re: Parsing each file of a directory to change once string instance to another
by Anonymous Monk on Mar 20, 2002 at 23:13 UTC |