in reply to CGI as an Inline Path

To actually have the name of your cgi script inline like that, you'll most likely have to go to Apache's mod_rewite

Sorry not a perl answer but, I can't think of a perl solution :(

grep
grep> cd /pub
grep> more beer