You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by David Romero <da...@vendingmexico.com> on 2006/03/31 18:36:26 UTC

Large aplications

What is the better way to write large aplications on mod_perl2?

You can write large aplications on separated handlers but is so slow 
write every new module on httpd.conf and on this way can't share db 
conections and consume large amount of ram on load common functions on 
every module.

Other way is write one handler and load modules dinamicaly for content, 
but you need to send a common var to every module and mayve this use 
large amount of memory.

What is the better way to do this?
or exist other better?
you have an example?

Thanks on advantge.





Unidos por un Mexico Democratico. www.eleccion2006.com


Re: Mail::POP3Client and pdf decode

Posted by "JupiterHost.Net" <ml...@jupiterhost.net>.

Charlie Smith wrote:
> I'm trying to decode an email that was pop'd. After writing
> the body to a disk file using the perl Mail::POP3Client routine
> $pop->BodyToFile( $fh, 1);
> 
> It looks all like text. So, I run following command to translate

by "it looks all like text" do you mean its "like words" or "an ascii 
armoured" string?

> body of mime message back to pdf for reading.
> perl -MMIME::Base64 -ne 'print decode_base64($_)' <test.txt >test.pdf


test.txt is base64 encoded verison correct?

does it have anytyhing in it that is not part of the encoding?

If so then you're decoding that line and putting it in the pdf file

After making sure test.txt is clean:

perl -mstrict -MFile::Slurp -MMIME::Base64 -we 'my $b64 = 
read_file("test.txt");write_file("test.pdf", decode_base64($b64));'

It cortaks if one of them fail so you're all set AFA error checking...

> No error messages, but file size is different from original file poped 

Yes, the base 64 encoded verison will be a differtent size than the guts 
that were encoded...

> from email attachment. When pdf file is brought up in browser, there 
> is no data.

- Is the decoded version 0 in size?
- are you outputting a header to tell the browser its a PDF?
- any errors in screen, logs, etc

Example code and url's to the symptoms would be extrememly handy to 
diagnose the problem, no?

Re: Mail::POP3Client and pdf decode

Posted by Charlie Smith <Sm...@ldschurch.org>.
Using cpan shell or webmin, I get following errro on attempt install
XML::DOM, so the whole install blows up.

Failed Test      Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/dom_jp_print.t                3    1  33.33%  2

Please assist.

Charlie


------------------------------------------------------------------------------

 
NOTICE: This email message is for the sole use of the
 intended recipient(s) and may contain confidential and
 privileged information. Any unauthorized review, use,
 disclosure or distribution is prohibited. If you are not the
 intended recipient, please contact the sender by reply email
 and destroy all copies of the original message.

------------------------------------------------------------------------------


Re: XML::DOM no compile

Posted by Perrin Harkins <pe...@elem.com>.
Hi Charlie,

> Using cpan shell or webmin, I get following errro on attempt install
> XML::DOM, so the whole install blows up.

This mailing list is specifically for discussion of mod_perl.  For
general Perl questions, try one of the places listed here: 
http://perl.apache.org/docs/offsite/other.html#Perl

- Perrin


XML::DOM no compile

Posted by Charlie Smith <Sm...@ldschurch.org>.
Using cpan shell or webmin, I get following errro on attempt install
XML::DOM, so the whole install blows up.

Failed Test      Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/dom_jp_print.t                3    1  33.33%  2

Please assist.

Charlie


------------------------------------------------------------------------------

 
NOTICE: This email message is for the sole use of the
 intended recipient(s) and may contain confidential and
 privileged information. Any unauthorized review, use,
 disclosure or distribution is prohibited. If you are not the
 intended recipient, please contact the sender by reply email
 and destroy all copies of the original message.

------------------------------------------------------------------------------


Re: Mail::POP3Client and pdf decode

Posted by Perrin Harkins <pe...@elem.com>.
On Thu, 2006-04-06 at 09:57 -0600, Charlie Smith wrote:
> Not sure if this is the right list. If not please let me know correct list.

This list if for discussion of mod_perl, not for general Perl questions.
For general Perl help, see the resources listed here:
http://perl.apache.org/docs/offsite/other.html

- Perrin


Mail::POP3Client and pdf decode

Posted by Charlie Smith <Sm...@ldschurch.org>.
I'm trying to decode an email that was pop'd. After writing
the body to a disk file using the perl Mail::POP3Client routine
$pop->BodyToFile( $fh, 1);

It looks all like text. So, I run following command to translate
body of mime message back to pdf for reading.
perl -MMIME::Base64 -ne 'print decode_base64($_)' <test.txt >test.pdf

No error messages, but file size is different from original file poped 
from email attachment. When pdf file is brought up in browser, there 
is no data.

Charlie
4/6/06





Not sure if this is the right list. If not please let me know correct list.

------------------------------------------------------------------------------

 
NOTICE: This email message is for the sole use of the
 intended recipient(s) and may contain confidential and
 privileged information. Any unauthorized review, use,
 disclosure or distribution is prohibited. If you are not the
 intended recipient, please contact the sender by reply email
 and destroy all copies of the original message.

------------------------------------------------------------------------------


Re: Large aplications

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2006-03-31 at 09:36 -0700, David Romero wrote:
> You can write large aplications on separated handlers but is so slow 
> write every new module on httpd.conf

Is it?  I find that most large applications break down into less than a
dozen different handlers.  It seems quite easy to put these in
httpd.conf to me.  If it bothers you, there are many alternatives, like
Apache::Dispatch, or web frameworks like the ones here:
http://perl.apache.org/products/app-server.html

(Didn't we add Catalyst and Maypole to this page already?  I thought I
remembered that.)

> and on this way can't share db 
> conections

Yes you can.  Apache::DBI and DBI->connect_cached work fine across
different modules.

> and consume large amount of ram on load common functions on 
> every module.

If you put those functions into a module and use that module from
multiple handlers, it will only get loaded once in each perl
interpreter.  It will not use more memory.

> Other way is write one handler and load modules dinamicaly for content, 
> but you need to send a common var to every module and mayve this use 
> large amount of memory.

I'm not sure what you mean by this.  What's the "common var" that you're
talking about?

- Perrin