in reply to Converting files and links to lowercase
To change the links is a bit tricker. I'd recommend using something like HTML::TreeBuilder and code like:sub wanted { rename($_, lc) or die "$_: $!" if !-d && /[A-Z]/; }
my $tree = HTML::TreeBuilder->new_from_file($fn); foreach my $a ($tree->lookdown('_tag', 'a')) { $a->attr('href') = lc($a->attr('href')); } open OUT, ">$fn" or die "Can't overwrite $fn ($!)"; print OUT $tree->as_HTML; close OUT; $tree->delete;
Hope this helps.
gav^
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Converting files and links to lowercase
by Anonymous Monk on Jan 31, 2002 at 02:41 UTC |