943,983 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 2598
  • Perl RSS
Oct 11th, 2006
0

Perl MIME handler -> how to get the invoking filehandle?

Expand Post »
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,
Matt
Last edited by MattEvans; Oct 11th, 2006 at 11:22 pm.
Similar Threads
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006
Oct 11th, 2006
0

Re: Perl MIME handler -> how to get the invoking filehandle?

ah.. got it. disregard this!

%ENV->{REQUEST_URI} returns the path/file. that's useable.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006
Oct 12th, 2006
0

Re: Perl MIME handler -> how to get the invoking filehandle?

You know you're getting then when you can answer your own questions!
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: Perl Ping Help
Next Thread in Perl Forum Timeline: debugger





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC