in reply to Converting files and links to lowercase

Something like this should do the trick:
sub wanted { rename($_, lc) or die "$_: $!" if !-d && /[A-Z]/; }
To change the links is a bit tricker. I'd recommend using something like HTML::TreeBuilder and code like:
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

    I did try using rename($_, lc) but it didn't work because Novell doesn't like renaming files to the same name with different case.

    Thanks for the HTML:Treebuilder suggestion - I'll definitely give it a go (and avoid problems caused by my lackluster regexp skills :)

    Hadley