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

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

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

 
0
  #1
Oct 11th, 2006
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.
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

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

 
0
  #2
Oct 11th, 2006
ah.. got it. disregard this!

%ENV->{REQUEST_URI} returns the path/file. that's useable.
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

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

 
0
  #3
Oct 12th, 2006
You know you're getting then when you can answer your own questions!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Perl Forum


Views: 2450 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Perl
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC