Re: Using MHonArc inside of mod_perl
On Mon, 27 Nov 2000, Aaron Johnson wrote: I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. [...] What are you trying to do? It sounds an awful like you're doing whatever it is the wrong way. :) My brain is running in powersave mode, so maybe I am missing something, but why can't you just use $foo = qx[mhonarc ...] or open FOO, "mhonarc ...|"? ... if you really want to call mhonarc for each request. :) - ask -- ask bjoern hansen - http://ask.netcetera.dk/ more than 70M impressions per day, http://valueclick.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using MHonArc inside of mod_perl
Thanks for the replies from people on the list. I solved my problem with the suggestion from Chris Nokleberg. He suggested the IO::String module. It did the trick. I had been using the qx function previously, but I needed variables from within my module to be available inside of MHonArc. Aaron Johnson Ask Bjoern Hansen wrote: On Mon, 27 Nov 2000, Aaron Johnson wrote: I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. [...] What are you trying to do? It sounds an awful like you're doing whatever it is the wrong way. :) My brain is running in powersave mode, so maybe I am missing something, but why can't you just use $foo = qx[mhonarc ...] or open FOO, "mhonarc ...|"? ... if you really want to call mhonarc for each request. :) - ask -- ask bjoern hansen - http://ask.netcetera.dk/ more than 70M impressions per day, http://valueclick.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using MHonArc inside of mod_perl
Aaron Johnson ([EMAIL PROTECTED]) said something to this effect: I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. Have you looked into IO::Stringy, and its friends (IO::Scalar, IO::ScalarArray, IO::Lines)? perldoc IO::Stringy NAME IO-stringy - I/O on in-core objects like strings and arrays DESCRIPTION This toolkit primarily provides modules for performing both traditional and object-oriented i/o) on things other than normal filehandles; in particular, IO::Scalar, IO::ScalarArray, and IO::Lines. ... An example from perldoc IO::Scalar: my $s; $SH = IO::Scalar-new(\$s); $SH-print("Hel", "lo, "); # OO style... print $SH "world!\n"; # ...or non-OO style! Causes $s to be set to: "Hello, world!\n" Good luck. (darren) -- Imagine the Creator as a stand up commedian - and at once the world becomes explicable. --H. L. Mencken - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using MHonArc inside of mod_perl
I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. It was suggested by Earl Hood (author of MHonArc) that I tie a string to a filehandle and then dup the filehandle to STDOUT. This sounds great, but I am unsure where to place the code that will allow for this or how this needs to be done with mod_perl. (I read perltie and perlopentut, but it didn't light any bulbs). I got some results, but none that produced the desired results. The closest was getting the output to be directed to the resulting HTML page, but not the variable. I saw a email from 97 in the mod_perl archives that discussed untie *STDOUT and then retying it back to Apache after the section of code was complete, but it showed STDOUT being linked to a file open, how could I assign that to a tied string then a filehandle as suggested by Earl Hood? Is anything like this bulit into mod_perl or another module at this time? http:[EMAIL PROTECTED] The process_input function is running under mod_perl. If any other information is needed please let me know. I have a horribly ugly hack working currently, but it prevents MHonArc from running in a normal manner (i.e. processing mailinglists) Aaron Johnson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using MHonArc inside of mod_perl
On Mon, 27 Nov 2000, Aaron Johnson wrote: I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. It was suggested by Earl Hood (author of MHonArc) that I tie a string to a filehandle and then dup the filehandle to STDOUT. This sounds great, but I am unsure where to place the code that will allow for this or how this needs to be done with mod_perl. (I read perltie and perlopentut, but it didn't light any bulbs). I got some results, but none that produced the desired results. The closest was getting the output to be directed to the resulting HTML page, but not the variable. How about tie()? Something that I've just added to the guide: http://perl.apache.org/guide/porting.html#STDIN_STDOUT_and_STDERR_streams I saw a email from 97 in the mod_perl archives that discussed untie *STDOUT and then retying it back to Apache after the section of code was complete, but it showed STDOUT being linked to a file open, how could I assign that to a tied string then a filehandle as suggested by Earl Hood? Is anything like this bulit into mod_perl or another module at this time? http:[EMAIL PROTECTED] The process_input function is running under mod_perl. If any other information is needed please let me know. I have a horribly ugly hack working currently, but it prevents MHonArc from running in a normal manner (i.e. processing mailinglists) Aaron Johnson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://jazzvalley.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I redirect STDOUT to a string WAS Using MHonArc inside of mod_perl
After one response and my own re-read of my first email, it appears that I have asked far too vague a question. The correct question is: How do I redirect STDOUT to a string? A suggestion was to tie a string to a filehandle and dup the filehandle to STDOUT. Is that valid? If it is, how in blue blazes do I do that? I read the perltie docs, the perlopentut and others I just don't see it. I will re-read them and hope my light bulb works. If anyone can point me to another source of information I would be grateful. Are there any modules for such oddness? I am posting to the mod_perl list in case there are any gotchas doing this under mod_perl. I realize it is border line off topic. I have MHonArc doing what I need it to, but it required a butcher knife when all I think I need is a butter knife. Aaron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using MHonArc inside of mod_perl
Perhaps you just need to use Apache::Filter? If not, you can cannibalize some of the code in Apache::Filter, it re-ties STDOUT. [EMAIL PROTECTED] (Aaron Johnson) wrote: I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. It was suggested by Earl Hood (author of MHonArc) that I tie a string to a filehandle and then dup the filehandle to STDOUT. This sounds great, but I am unsure where to place the code that will allow for this or how this needs to be done with mod_perl. (I read perltie and perlopentut, but it didn't light any bulbs). I got some results, but none that produced the desired results. The closest was getting the output to be directed to the resulting HTML page, but not the variable. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]