10.07.2015 Views

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 2 ■ POPULAR CGI MODULES 37Figure 2-1. A fatal error sent <strong>to</strong> the browserThen call the set_message() function, supplying an argument of the message you want <strong>to</strong>appear:set_message("This is a better message for the end.");Incorporating the set_message() function in<strong>to</strong> the example in Listing 2-1 yields the codeshown in Listing 2-2.Listing 2-2. Using set_message with CGI::Carp#!/usr/bin/perl -Tuse strict;use CGI qw/:standard/;use CGI::Carp qw(fatalsToBrowser set_message);set_message("This is a better message for the end.");

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!