$current_url = $ENV{REQUEST_URI}; $current_url =~ s/\/sub-dir\/name/.*\///;