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. ...
In reply to Converting files and links to lowercase by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |