+# only lc() the last portion of an href
+sub lc_last($)
+{
+ my $href = shift;
+ my @hrefsplit = split('/', $href);
+ # change the last portion (the filename), if it exists
+ if ($#hrefsplit > 0) {
+ @hrefsplit[$#hrefsplit] = lc( @hrefsplit[$#hrefsplit] );
+ $href = join("/", @hrefsplit);
+ }
+ return $href;
+}
+