Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Mod_Perl2 getting started

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


joe at zumu

Aug 21, 2012, 12:27 PM

Post #1 of 8 (719 views)
Permalink
Mod_Perl2 getting started

Hi,
I’m finding the online documentation regarding mod_perl2 confusing
with regards to all the various modules dealing with request structures etc:
APR::Request, Apache2::Request, Apache2::RequestRec, Apache2::Upload,
etc.
Does anyone know of a tutorial or example code that sorts these out?
Ideally a simple one module working code response handler that illustrates access to the
parsed request, handles args as querystrings and Post data, uploads a file or
two, and returns an html page to the requestor. Anyone have something like that?
Thanks very much in advance,
Joe N


fred at redhotpenguin

Aug 21, 2012, 12:43 PM

Post #2 of 8 (698 views)
Permalink
Re: Mod_Perl2 getting started [In reply to]

Try this link:

http://perl.apache.org/docs/2.0/user/intro/start_fast.html

For handling POST data you will likely want to install libapreq2,
which is basically the equivalent of CGI:

http://search.cpan.org/dist/libapreq2/

use Apache2::Request;

$req = Apache2::Request->new($r);
@foo = $req->param("foo");
$bar = $req->args("bar");

On Tue, Aug 21, 2012 at 12:27 PM, <joe [at] zumu> wrote:
> Hi,
>
> I’m finding the online documentation regarding mod_perl2 confusing
> with regards to all the various modules dealing with request structures etc:
> APR::Request, Apache2::Request, Apache2::RequestRec, Apache2::Upload,
> etc.
>
> Does anyone know of a tutorial or example code that sorts these out?
>
> Ideally a simple one module working code response handler that illustrates
> access to the
> parsed request,
> handles args as querystrings and Post data, uploads a file or
> two, and returns an html
> page to the requestor. Anyone have something like that?
>
> Thanks very much in advance,
> Joe N


jordan at viviotech

Aug 21, 2012, 12:53 PM

Post #3 of 8 (698 views)
Permalink
Re: Mod_Perl2 getting started [In reply to]

I'd recommend the book:
http://www.amazon.com/Writing-Apache-Modules-Perl-C/dp/156592567X

It's a bit old but many of the topics in it are still relevant and
useful. Plus, with it being so old, you can get used copies of it very
affordably.

Hope this helps!

Warm Regards,
Jordan Michaels

On 08/21/2012 12:27 PM, joe [at] zumu wrote:
> Hi,
> I’m finding the online documentation regarding mod_perl2 confusing
> with regards to all the various modules dealing with request structures etc:
> APR::Request, Apache2::Request, Apache2::RequestRec, Apache2::Upload,
> etc.
> Does anyone know of a tutorial or example code that sorts these out?
> Ideally a simple one module working code response handler that
> illustrates access to the
> parsed request,
> handles args as querystrings and Post data, uploads a file or
> two, and returns an html
> page to the requestor. Anyone have something like that?
> Thanks very much in advance,
> Joe N


joe at zumu

Aug 21, 2012, 1:32 PM

Post #4 of 8 (697 views)
Permalink
Re: Mod_Perl2 getting started [In reply to]

-----Original Message-----
From: Fred Moyer
Try this link:
http://perl.apache.org/docs/2.0/user/intro/start_fast.html
--------------------------
Yes, thanks - I've read that.



-----Original Message-----
From: Fred Moyer
For handling POST data you will likely want to install libapreq2,
which is basically the equivalent of CGI:

http://search.cpan.org/dist/libapreq2/

use Apache2::Request;

$req = Apache2::Request->new($r);
@foo = $req->param("foo");
$bar = $req->args("bar");
-----------------------------------------

Thanks for the specifics- so something like this (below) should not
just die without an error message if I'm on track? (It just dies without
response
or error message - if I remove Apache2::Request->new($r) call it reponds
with the message to the browser..

So I 'm thinking libareq2 is not installed correctly yet?
My server provider is installing the apahce + perl etc. so
I'm partly at their mercy to get it correct. I just had no verified
test cases that I could say to them: This *should* work if the installation
is correct...

Thanks agains,
Joe N


##############
package respHandler;
use strict;

use Apache2::Const qw(:common);
use Apache2::Request ();
1;

sub handler {
my $r = shift;

my $req = Apache2::Request->new($r);

$r->content_type('text/plain');
print "mod_perl 2.0 OK!\n";

return OK;
}
#############


randolf at modperl

Aug 21, 2012, 2:13 PM

Post #5 of 8 (696 views)
Permalink
Re: Mod_Perl2 getting started [In reply to]

> Hi,
> I´m finding the online documentation regarding mod_perl2 confusing
> with regards to all the various modules dealing with request structures etc:
> APR::Request, Apache2::Request, Apache2::RequestRec, Apache2::Upload,
> etc.
> Does anyone know of a tutorial or example code that sorts these out?
> Ideally a simple one module working code response handler that illustrates access to the
> parsed request, handles args as querystrings and Post data, uploads a file or
> two, and returns an html page to the requestor. Anyone have something like that?
> Thanks very much in advance,
> Joe N

Hi Joe. I wrote one guide that has helped a few people get started:

http://www.modperl.pl/how-to/

It's still a work-in-progress, and although it doesn't show you
everything that you're asking for, it will get you started.

Accessing query strings is covered in the Apache::Request module
documentation -- "param" is the keyword to search for. I recommend
that you develop a clear understanding of how this works before
tackling file uploads, because it will make the learning process with
regard to handling file uploads a lot easier.

Randolf Richardson - randolf [at] inter-corporate
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/


k.ghadami at ibson

Aug 22, 2012, 1:11 AM

Post #6 of 8 (688 views)
Permalink
Re: Mod_Perl2 getting started [In reply to]

Hi Joe,
have also a look at Frameworks and Interfaces like PSGI or Catalyst.
They provide a more generic way to do these things:

"parsed request, handles args as querystrings and Post data, uploads a
file or two, and returns an html page to the requestor"

that way you can use mod_perl in the background wich give you the
flexibility to switch to other Interfaces (e.g. fcgi) and servers on need.

best regards

keywan

Am 21.08.2012 23:13, schrieb Randolf Richardson:
>> Hi,
>> I´m finding the online documentation regarding mod_perl2 confusing
>> with regards to all the various modules dealing with request structures etc:
>> APR::Request, Apache2::Request, Apache2::RequestRec, Apache2::Upload,
>> etc.
>> Does anyone know of a tutorial or example code that sorts these out?
>> Ideally a simple one module working code response handler that illustrates access to the
>> parsed request, handles args as querystrings and Post data, uploads a file or
>> two, and returns an html page to the requestor. Anyone have something like that?
>> Thanks very much in advance,
>> Joe N
> Hi Joe. I wrote one guide that has helped a few people get started:
>
> http://www.modperl.pl/how-to/
>
> It's still a work-in-progress, and although it doesn't show you
> everything that you're asking for, it will get you started.
>
> Accessing query strings is covered in the Apache::Request module
> documentation -- "param" is the keyword to search for. I recommend
> that you develop a clear understanding of how this works before
> tackling file uploads, because it will make the learning process with
> regard to handling file uploads a lot easier.
>
> Randolf Richardson -randolf [at] inter-corporate
> Inter-Corporate Computer & Network Services, Inc.
> Beautiful British Columbia, Canada
> http://www.inter-corporate.com/
>
>


--
Keywan Ghadami
Entwicklung
ibson
Fritz-Arnold-Str. 23
78467 Konstanz
Tel.: +49 (0)75 31 / 81 39 7 93
Fax: +49 (0)75 31 / 81 39 7 89
E-Mail: info [at] ibson <mailto:info [at] ibson>
Web: www.ibson.com <http://www.ibson.com/>
QuickLinks: Produkte <http://www.ibson.com/Produkte> | Lösungen
<http://www.ibson.com/Loesungen> | Services & Support
<http://www.ibson.com/Services> | News <http://www.ibson.com/News> |
Kunden & Referenzen <http://www.ibson.com/Referenzen> | Kontakt
<http://www.ibson.com/Kontakt>

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese E-Mail. Das Kopieren sowie die
Weitergabe dieser E-Mail ist nicht gestattet.

This E-Mail contains confidential and/or legally protected information.
If you are not the correct addressee or have received this E-Mail
erroneously, please inform the sender immediately and delete this
E-Mail. The copying as well as the transmitting of this E-Mail is not
permitted


Alexander.Elgert at external

Aug 22, 2012, 4:33 AM

Post #7 of 8 (690 views)
Permalink
AW: Mod_Perl2 getting started [In reply to]

http://perl.apache.org/docs/1.0/guide/porting.html

--
Deutsche Telekom AG
Seamless ICT Security Infrastructure & Management
im Auftrag T-Systems International GmbH
Dipl. Inf Alexander Elgert
Langwadener Strasse 17
64625 Bensheim
+49 176 22 717 661 (Mobil)
+49 671 83419-12 (Tel)
+49 671 83419-30 (Fax)
E-Mail: alexander.elgert [at] gmx

________________________________________
Von: Keywan Ghadami [k.ghadami [at] ibson]
Gesendet: Mittwoch, 22. August 2012 10:11
An: modperl [at] perl
Betreff: Re: Mod_Perl2 getting started

Hi Joe,
have also a look at Frameworks and Interfaces like PSGI or Catalyst.
They provide a more generic way to do these things:

"parsed request, handles args as querystrings and Post data, uploads a file or two, and returns an html page to the requestor"

that way you can use mod_perl in the background wich give you the flexibility to switch to other Interfaces (e.g. fcgi) and servers on need.

best regards

keywan

Am 21.08.2012 23:13, schrieb Randolf Richardson:

Hi,
I´m finding the online documentation regarding mod_perl2 confusing
with regards to all the various modules dealing with request structures etc:
APR::Request, Apache2::Request, Apache2::RequestRec, Apache2::Upload,
etc.
Does anyone know of a tutorial or example code that sorts these out?
Ideally a simple one module working code response handler that illustrates access to the
parsed request, handles args as querystrings and Post data, uploads a file or
two, and returns an html page to the requestor. Anyone have something like that?
Thanks very much in advance,
Joe N


Hi Joe. I wrote one guide that has helped a few people get started:

http://www.modperl.pl/how-to/

It's still a work-in-progress, and although it doesn't show you
everything that you're asking for, it will get you started.

Accessing query strings is covered in the Apache::Request module
documentation -- "param" is the keyword to search for. I recommend
that you develop a clear understanding of how this works before
tackling file uploads, because it will make the learning process with
regard to handling file uploads a lot easier.

Randolf Richardson - randolf [at] inter-corporate<mailto:randolf [at] inter-corporate>
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/





--
Keywan Ghadami
Entwicklung
ibson
Fritz-Arnold-Str. 23
78467 Konstanz
Tel.: +49 (0)75 31 / 81 39 7 93
Fax: +49 (0)75 31 / 81 39 7 89
E-Mail: info [at] ibson<mailto:info [at] ibson>
Web: www.ibson.com<http://www.ibson.com/>
QuickLinks: Produkte<http://www.ibson.com/Produkte> | Lösungen<http://www.ibson.com/Loesungen> | Services & Support<http://www.ibson.com/Services> | News<http://www.ibson.com/News> | Kunden & Referenzen<http://www.ibson.com/Referenzen> | Kontakt<http://www.ibson.com/Kontakt>

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das Kopieren sowie die Weitergabe dieser E-Mail ist nicht gestattet.

This E-Mail contains confidential and/or legally protected information. If you are not the correct addressee or have received this E-Mail erroneously, please inform the sender immediately and delete this E-Mail. The copying as well as the transmitting of this E-Mail is not permitted


randolf at modperl

Aug 22, 2012, 4:38 PM

Post #8 of 8 (687 views)
Permalink
Re: Mod_Perl2 getting started [In reply to]

> Thank you - that's one of the better guides I've seen.
> Funny I didn´t catch it through Google.

Thanks for the feedback. It's pretty new so I think it will be some
time before Google figures out where to place it in the search
results.

If you know of anyone else who would find it interesting, you're
more than welcome to share a link to it with them. My main concern
is that I want to see more people using ModPerl 2.

> Joe N
>
> -----Original Message-----
> From: Randolf Richardson
> Sent: Tuesday, August 21, 2012 5:13 PM
> To: modperl [at] perl
> Subject: Re: Mod_Perl2 getting started
>
> > Hi,
> > I´m finding the online documentation regarding mod_perl2 confusing
> > with regards to all the various modules dealing with request structures
> > etc:
> > APR::Request, Apache2::Request, Apache2::RequestRec, Apache2::Upload,
> > etc.
> > Does anyone know of a tutorial or example code that sorts these out?
> > Ideally a simple one module working code response handler that illustrates
> > access to the
> > parsed request, handles args as querystrings and Post data, uploads a file
> > or
> > two, and returns an html page to the requestor. Anyone have something like
> > that?
> > Thanks very much in advance,
> > Joe N
>
> Hi Joe. I wrote one guide that has helped a few people get started:
>
> http://www.modperl.pl/how-to/
>
>


Randolf Richardson - randolf [at] inter-corporate
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.