Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've been given the task of moving a (somewhat) poorly written website from an IIS to an apache server. Unfortunately, the IIS server was case insensitive and creator of the website was somewhat inconsistent in their use of capitals.
What I want to do is change all the filenames to lower case and then make sure any links point to the new filename. I've managed the first part, but I need some help on the second. Can anyone offer any suggestions?
Thanks, Hadley
(my code so far...)use File::Find; find(\&wanted, 'y:\health\biru'); sub wanted { if ($_ ne "." && lc() ne $_) { print("Renaming $_ to " . lc() . "\n"); rename($_, lc() . "_______") or die("failed: $!"); rename(lc() . "_______", lc()) or die("failed: $!"); } if (/\.html$/) { //change any href="XXX" or src="XXX" to href="xxx" etc. ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(cLive ;-) Re: Converting files and links to lowercase
by cLive ;-) (Prior) on Jan 29, 2002 at 09:24 UTC | |
by gav^ (Curate) on Jan 29, 2002 at 09:46 UTC | |
by Anonymous Monk on Jan 31, 2002 at 02:45 UTC | |
|
Re: Converting files and links to lowercase
by grep (Monsignor) on Jan 29, 2002 at 09:25 UTC | |
by Anonymous Monk on Jan 31, 2002 at 01:12 UTC | |
|
Re: Converting files and links to lowercase
by gav^ (Curate) on Jan 29, 2002 at 09:39 UTC | |
by Anonymous Monk on Jan 31, 2002 at 02:41 UTC | |
|
Re: Converting files and links to lowercase
by seattlejohn (Deacon) on Jan 31, 2002 at 06:39 UTC |