Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 68345 invoked from network); 14 Aug 2007 02:47:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Aug 2007 02:47:24 -0000 Received: (qmail 95570 invoked by uid 500); 14 Aug 2007 02:47:16 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 95554 invoked by uid 500); 14 Aug 2007 02:47:16 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 95392 invoked by uid 99); 14 Aug 2007 02:47:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Aug 2007 19:47:15 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [64.151.90.21] (HELO redhotpenguin.com) (64.151.90.21) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2007 02:47:13 +0000 Received: (qmail 4669 invoked by uid 1005); 13 Aug 2007 19:46:52 -0700 Received: from c-69-181-236-40.hsd1.ca.comcast.net (HELO pooky.redhotpenguin.com) (69.181.236.40) (smtp-auth username fred@redhotpenguin.com, mechanism plain) by app2.redhotpenguin.com (qpsmtpd/0.32) with ESMTP; Mon, 13 Aug 2007 19:46:48 -0700 Message-ID: <46C117A0.8080608@redhotpenguin.com> Date: Mon, 13 Aug 2007 19:46:56 -0700 From: Fred Moyer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Mag Gam , mod_perl list Subject: Re: Correct way to upload a file References: <1cbd6f830708101925o2f78c707jc0c5577425d3f4ec@mail.gmail.com> <7474654C-2004-4F66-858B-A11BCC4A7543@2xlp.com> <1cbd6f830708110646t61f56c76rb10dbe052705c6e7@mail.gmail.com> <59278.69.224.151.211.1186852732.squirrel@www.redhotpenguin.com> <1cbd6f830708111642r3c9cc712yd3beba115a86a516@mail.gmail.com> In-Reply-To: <1cbd6f830708111642r3c9cc712yd3beba115a86a516@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Check-By: app2.redhotpenguin.com X-Old-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC [please cc the mod_perl list when responding] Mag Gam wrote: > Fred: > > Thanks. Looks like I may look into Mason for its simplification. I don't think I have a the patience or enthusiasm to learn the REquestReq feature of Mp2. It's not that hard, I would say it's no more complex than Mason (but there are varying schools of thought on that subject which I will not go into here). Here is a hello world handler to give you an example of how to get started. conf/httpd.conf -------------------------- SetHandler perl-script # tells apache mod_perl handles the request PerlResponseHandler My::Hello # My::Hello::handler handles / requests lib/My/Hello.pm ------------------------ package My::Hello; use strict; use warnings; use Apache2::RequestRec (); # for $r->content_type use Apache2::RequestIO (); # for $r->print use Apache2::Const -compile => qw( OK ); # for Apache2::Const::OK sub handler { my $r = shift; # <== here is where you get $r $r->content_type('text/plain'); # set the content type to text/plain $r->print("Hello world!"); # print the response to the client return Apache2::Const::OK; # return 200 OK } HTH > On 8/11/07, *Fred Moyer* > wrote: > > > I noticed I have to use Apache::Request and Apache::Cookie. > > In, http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html, > there is > > a > > $r which is request object. How do I create that? Is there an example > > anywhere I can follow? > > It sounds like you haven't created a mod_perl handler before, this page > should answer your questions. > > http://perl.apache.org/docs/2.0/user/intro/start_fast.html > > > On 8/10/07, Jonathan Vanasco > wrote: > >> > >> > >> On Aug 10, 2007, at 10:25 PM, Mag Gam wrote: > >> > >> > I have just started learning perl and mod_perl, and I must admit I > >> > am enjoying it a lot! > >> > I am tying to upload a file, so I can do some calculations to the > >> > file, my question is what is the "correct" and most > "efficient" way > >> > to upload the file, and perform the calculations? Should I > consider > >> > using the CGI module? > >> > >> libapreq > >> http://httpd.apache.org/apreq/ > >> > >> CGI is a close second > >> > > > > >