$a =~ s#(/[^/]*)$##; $bar = $1;