On Tue, 6 Apr 2004 22:30:13 +0200, "Tamara" <>
wrote:
>How can I change meta tag description in all htm documents including all
>files in subdirectories, with using perl on Windows XP?
>E.g. new meta tag is "New meta tag", and I want change it in all htm file
>including htm files in subdirectories.
It is not clear at all what you want to do, but in any case File::Find
seems the way to go, as another poster already suggested. OTOH this is
not an help desk, however please see if you can adapt the following
minimal example to your needs:
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
my @dirs=grep { -d or !warn "`$_': no such directory!\n" } @ARGV;
die "Usage: $0 <dir> [<dirs>]\n" unless @dirs;
@ARGV=();
find { no_chdir => 1,
wanted => sub {
push @ARGV, $_
if /\.html?$/ and -f;
} }, @dirs;
$^I = '.bak';
s|(</?)meta-tag>|$1actual-tag>|g, print while <>;
__END__
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
|