Perlaccess : Tutorials : Input and Output
Advanced Output (2.2)
by Jacob A. Wheeler
http://www.bigresources.com

The following code examples show an alternate way of outputing HTML code instead of using a bunch of print statements.

So instead of doing the following:

  1. print "<html>\n";
  2. print "<body bgcolor=\"white\">\n";
  3. print "etc...\n";

You can use:

  1. print qq~
  2. <html>
  3. <body bgcolor="white">
  4. etc...
  5. ~;

Or...

  1. print qq|
  2. <html>
  3. <body bgcolor="white">
  4. etc...
  5. |;

When you use the last two output methods (qq~ and qq|) you do not have to worry about formatting parenthesis correctly by using backslashes to prevent PERL from formatting the output wrong.