Learning Perl & Apache for a Uni Assignment

Click For Summary

Discussion Overview

The discussion centers around a university student's assignment involving the integration of Perl modules with the Apache web server. Participants share resources, documentation, and insights related to both CGI and mod_perl, as well as general Perl programming practices. The scope includes technical explanations and recommendations for further reading.

Discussion Character

  • Technical explanation
  • Exploratory
  • Homework-related

Main Points Raised

  • Jonathan seeks documentation on how Perl interacts with Apache, expressing a high-level understanding of the server-client model but needing more context.
  • One participant explains that the basic interaction is through CGI and mentions mod_perl as an advanced option, providing links to relevant documentation.
  • Another participant suggests the Perl IRC channel as a resource for further questions after reviewing documentation.
  • A participant clarifies that mod_perl allows Perl programs to interface more closely with the server, improving performance under load.
  • Jonathan expresses uncertainty about whether his scripts are CGI or mod_perl based, noting that his current programs are basic.
  • There is a discussion about the "Camel Book" (Programming Perl) and its limited information on Perl and Apache interaction.
  • Jonathan later confirms that his scripts are mod_perl-based and asks for recommendations on mod_perl documentation and clarification on the meaning of "$r" in that context.

Areas of Agreement / Disagreement

Participants share resources and insights, but there is no consensus on the specifics of Jonathan's assignment or the best approach to take, as he is still exploring the differences between CGI and mod_perl.

Contextual Notes

There is uncertainty regarding the specific nature of Jonathan's scripts and their classification as CGI or mod_perl based. The discussion also highlights the varying levels of familiarity with Perl and Apache among participants.

Who May Find This Useful

Students and practitioners interested in integrating Perl with the Apache web server, particularly those new to Perl programming or web development.

Chromium
Messages
56
Reaction score
0
hey everyone,

I'm a 3rd year uni student studying software engineering, and I recently got my first job working in an IT office at my school. One of my first assignments is to combine two Perl modules that deal with the Apache web server. I've never done work with Perl or Apache before, but I've been doing a lot of reading & coding since I was given this assignment. I've learned a lot in last couple of days (dude, the @_ array is such a cool feature!). I do have one question though (this will probably be the first in a series of questions on this assignment):

Does anyone know of any good documentation that could give me some contextual information regarding how Perl works with Apache? I have a high-level understanding of how the server-client model works, but that's not enough. I found this, but I think it'll only be useful once I have a better idea of what exactly is going on: http://perl.apache.org/docs/1.0/api/Apache.html#The_Request_Object

thanks,

--Jonathan
 
Technology news on Phys.org
The basic way it works is just CGI. You can get into mod_perl, but you don't need to. Mod_perl is something to play with if you really get into it and have access to play with your Apache build. See http://httpd.apache.org/docs/2.2/howto/cgi.html.

For Perl documentation I always keep http://perldoc.perl.org/index-functions-by-cat.html open. Actually, I lied. I use the condensed version at http://perldoc.perl.org/perlfunc.html#Perl-Functions-by-Category. The Perl Cookbook and "Camel Book" are good too. I use those in addition to the perldoc website. And don't forget to search CPAN, since the odds are someone has already written most of your code for you.

There's really almost nothing at all to getting a Perl script to run in Apache. Let me know if you need anything besides what's there.
 
Last edited by a moderator:
Oh, and the perl IRC channel on freenode is another good place to ask questions when you've checked the documentation and are still stuck.
 
If you started with the mod_perl page because that's what the server and your scripts are using, then it's more complicated :-p. mod_perl just allows your perl programs to interface with the server more closely. It allows allows Apache to speed things up a lot under heavy load by only compiling scripts when necessary and not each time a page is loaded. It also allows your scripts to screw with Apache internals while it's running.

Are your programs CGI or mod_perl based? Did you just go to the perl.apache.org (mod_perl) page because it said "perl"? I can recommend some mod_perl documentation if needed.
 
Last edited:
Ah, this is great! Thanks so much! I'll definitely be looking into this some more. I'm not sure if my programs are CGI-based or mod_perl-based. Probably neither at this point because the Perl programs I've written so far are very basic (the most complicated one does some very basic file I/O stuff).

As for books, I do have the "camel" book (I think it's called "Perl in a nutshell" or something). But the information on how Perl interacts with Apache is sparse at best in that book, I think.

--Jonathan
 
Chromium said:
Ah, this is great! Thanks so much! I'll definitely be looking into this some more. I'm not sure if my programs are CGI-based or mod_perl-based. Probably neither at this point because the Perl programs I've written so far are very basic (the most complicated one does some very basic file I/O stuff).

As for books, I do have the "camel" book (I think it's called "Perl in a nutshell" or something). But the information on how Perl interacts with Apache is sparse at best in that book, I think.

--Jonathan

Programming Perl is the camel book :-p. Yeah, read the CGI page. There's almost nothing to interfacing the two. You just produce the html in your Perl script and the server runs it and displays the output to a browser.

Don't worry about mod_perl or anything on the perl.apache.org site. Stick to httpd.apache.org.
 
hey kote,

After doing some more reading, it turns out that my scripts are mod_perl-based. So I was wondering if you could recommend some good mod_perl documentation?

also, a quick question: What is "$r" in the context of mod_perl? Is it some kind of cookie that's sent to the server (just a guess based on what little I've read so far)?

thanks!

--Jonathan
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
8K
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 86 ·
3
Replies
86
Views
13K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
18
Views
3K
Replies
19
Views
3K
Replies
2
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 5 ·
Replies
5
Views
7K