my $url = qq|/directory/directory/some-file.html|; print substr($url, 0, rindex($url,'/')),"\n";