Learning Perl & Apache for a Uni Assignment

In summary, learning Perl and Apache for a uni assignment involves gaining knowledge and skills in using the Perl programming language and the Apache web server. This includes understanding the syntax and functions of Perl, as well as configuring and managing Apache for hosting websites and applications. The goal of this assignment is to develop proficiency in these tools for creating dynamic and interactive web content.
  • #1
Chromium
56
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
  • #2
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:
  • #3
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.
 
  • #4
If you started with the mod_perl page because that's what the server and your scripts are using, then it's more complicated :tongue:. 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:
  • #5
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
 
  • #6
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 :tongue:. 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.
 
  • #7
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
 

1. What is Perl?

Perl is a high-level, interpreted programming language that is commonly used for creating dynamic websites and web applications. It is known for its flexibility, powerful text processing capabilities, and support for various programming paradigms.

2. What is Apache?

Apache is a popular open-source web server software that is used to host websites and web applications. It is known for its stability, security, and flexibility, making it a popular choice for hosting websites of all sizes.

3. How can I use Perl and Apache for a uni assignment?

Perl and Apache can be used together for a uni assignment in various ways, such as creating a dynamic website or developing a web application. You can also use them for data analysis, text processing, and other tasks that require scripting and web server capabilities.

4. Is it difficult to learn Perl and Apache?

Learning Perl and Apache can be challenging for beginners, but with the right resources and dedication, it is certainly achievable. It is recommended to have some basic programming knowledge and familiarity with web development concepts before diving into these technologies.

5. Are there any resources available for learning Perl and Apache?

Yes, there are plenty of online tutorials, books, and courses available for learning Perl and Apache. Some recommended resources include the official Perl and Apache documentation, online learning platforms like Codecademy and Udemy, and various books such as "Learning Perl" and "Apache: The Definitive Guide".

Similar threads

  • Programming and Computer Science
Replies
9
Views
8K
Replies
7
Views
224
  • Programming and Computer Science
Replies
8
Views
1K
  • New Member Introductions
Replies
1
Views
40
Replies
18
Views
1K
  • STEM Academic Advising
Replies
1
Views
924
Replies
2
Views
876
  • STEM Academic Advising
Replies
3
Views
753
  • STEM Academic Advising
Replies
3
Views
914
  • Programming and Computer Science
3
Replies
86
Views
10K
Back
Top