[Ilugc] LJ Tech Tip

  • From: sbharathi@xxxxxxxxxxxxx (Bharathi Subramanian)
  • Date: Wed Aug 17 17:09:02 2005

Tech Tip from Linux Journal

If you're learning how to write CGI scripts in Perl, you can save
yourself some time looking at error logs by putting error messages in
your browser session. Add "fatalsToBrowser" to your "use CGI" line to
turn it on. Try this:

 #!/usr/bin/perl -Tw

 use strict;
 use CGI::Carp qw(fatalsToBrowser);

 print "Content-type: text/plain\n\n";
 prnit "Hello world!";

In general, it's a bad idea security-wise to expose details about your
system, so you probably will choose to turn off "fatalstoBrowser" on
your production site.

HTH :)
--
Bharathi S

Other related posts: