If I understand correctly, you can definately do the first one using CGI::Session
. I think you can do the second if you use Apache (and possibly IIS).
If you call the CGI script Resources.cgi, you should be able to configure Apache (it may be enabled by default even) to execute it when called as "Resources/stuff/goes/here". Once that is working, check out the path_info method of CGI; it should let you fetch the last bit of the URL the script was called with (ex/ "stuff/goes/here").
I know both of these work, as I use them myself.
Update You might also be interested in the Jellybean Object Web Server. I don't personally use it, but it is written by our very own chromatic.
NB I know that I responded to this and then front-paged it, but I think it is a good question. I'm honestly not trying to gain XP, and you can feel free to downvote this if you really think it was in bad form to front-page and reply.