I have NO CLUE how I managed to ignore the fact that I was
checking a non-existant variable.. nor how I managed to "check"
that my "fix" "worked" with completely broken code.
I also have NO CLUE why perl didn't barf when I started checking
the state of a non-existant variable, but I'm sadly not surprised
about it's permissiveness.
my $href = shift;
my @hrefsplit = split('/', $href);
# change the last portion (the filename), if it exists
- if ($#array > 0) {
- @hrefsplit[$#array] = lc( @hrefsplit[$#array] );
+ if ($#hrefsplit > 0) {
+ @hrefsplit[$#hrefsplit] = lc( @hrefsplit[$#hrefsplit] );
$href = join("/", @hrefsplit);
}
return $href;