Exercises, examples and other material relating to training module P408. This topic is presented on public course Using Perl on the Web
You're not the first person to write a CGI script in Perl. If you want to use standard modules from the CPAN, or supplied with Perl itself, there are plenty out there and we introduce you to some of them in this training module.
Related technical and longer articlesUsing LWP to write Web Clients
|Articles and tips on this subject||updated|
|4099||Perl Dancer - a Perl Framework - Installation and first test|
The most commonly requested Web Frameworks for our training courses are CodeIgniter and Zend (using PHP), Django (using Python) and Rails (using Ruby). However, Perl is also an excellent language for web use - in fact it was the original predominant web language prior to the growth of those other languages. ...
|4100||Perl Dancer - from installation to your first real application|
Previous article - Perl Dancer - Installation and first test. Summary of that article - What is Dancer / How do I install it / Installing requires CPAN modules / Creating an application / testing that it worked.
The application in the first article provides you with no more that a welcome page to ...
|3485||Perl - retrieving and caching web resources|
Is there some useful data on the web which you would like to use in your Perl script? If there is, go ahead and download it, grab the page, store it as a file and use it ... subject of course to copyright and re-use rules. But, alas, how can you then keep your Perl script up to date with current data ...
|2416||Automating access to a page obscured behind a holding page|
Question: "I have a web page that I visit which sends me an initial response to say that it's working on the results, and then the results appear a few seconds later. I want to use an automed process / program on my computer to visit this page and store the final results, rather than having to access ...
|2402||Automated Browsing in Perl|
I'm reminded on today's Perl course just how powerful some of the modules are, and how much you can do in so little code.
LWP::UserAgent turns your Perl into an automated browser .. the following four lines reading the robots.txt off my web site.
$connex = new LWP::UserAgent("agent" ...
|2229||Do not re-invent the wheel - use a Perl module|
"If you think 'surely someone has done this before', you're probably right ... and in Perl, you'll find the resource you need available as a module on your system, or if it's not quite to common, on the CPAN". I was reminded of this advise today, when I got involved with web site checking ... and rather ...
|975||Answering ALL the delegate's Perl questions|
During courses, questions arise. "I'll get back to that" could make people feel that I'm brushing something off ... except that I explain, early on, that some questions require a great deal of background knowledge to be answered sensibly. And I keep a list of topics that I'll be getting back to ...
Examples from our training material
|askuser.tt|| Second template (form) - Dancer|
|bin_app.pl|| Perl Dancer - Controllers and routes|
|cc2|| Use LWP UserAgent to check and see if a remote site has changed|
|cgi1.pl|| Simple demo of CGI.pm|
|cgilite.pl|| Using CGI_Lite.pm - simple example|
|cgis.pl|| Using CGI.pm as a structured code|
|config.yml|| configuration - Dancer|
|cookie.pl|| Setting, reading and deleting cookies|
|ecbgrab.pl|| Grabbing a network resource through LWP UserAgent|
|fred|| Grabbing a web page for echo|
|freda|| Grabbing a web page for cache|
|frederick|| Grabbing a web page for cache if refresh needed|
|goodlinks|| Validate links from a page (LWP)|
|grab2|| A first example - grabbing a web page via LWP|
|page_checker|| Using LWP::Simple to find all links from a web page|
|township.tt|| first inner template - Dancer|
|townstyle.css|| Style sheet - Dancer|
|wellhouseframe.tt|| layout example - Dancer|
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from [here]
Topics covered in this module
Using CGI for cookies.
Legal and security issues with cookies.
Using LWP to write your own clients.
A note of caution.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.