I've just registered a MIME handler for a custom filetype; I've got the basic redirection sorted, all files of type XRM get sent to a 'dumb' perl script that echos predefined values.

But, how do I read in the contents of the XRM file that invoked the perl script? Does it come into STDIN? More importantly, how do I get the folder of the file that invoked the script? I need to read in both the XRM file and potentially a number of other files referenced in that file... i.e. if the file "index.xrm" contains the string "manifest='index.xmf'" in the correct place, "index.xmf" should be read from the same folder as "index.xrm".

cwd() echos the folder that my script is in; and essentially, I want to chdir() to the folder where the invoking file is in as soon as the script is executed. Can I do this without using the browser location environment variable?

Thanks for reading,

Recommended Answers

All 2 Replies

ah.. got it. disregard this!

%ENV->{REQUEST_URI} returns the path/file. that's useable.

You know you're getting then when you can answer your own questions! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.