The HTML tags are embedded in the here document to avoid using multiple print statements : Print « Language Basics « Perl






The HTML tags are embedded in the here document to avoid using multiple print statements

  


#!/bin/perl
print <<EOF;     #here document in a CGI script
Content-type: text/html

<HTML><HEAD><TITLE>Title</TITLE></HEAD>
    <H1><CENTER>Dear!!</CENTER></H1>
    </HTML>
EOF

   
    
  








Related examples in the same category

1.Prints a welcome statement with escape character
2.Prints a welcome statement with several escape characters
3.You can pass a list of items to print, where you separate the list items with commas:
4.The print command prints out the text you provide it
5.Output two values in one print statement
6.print "Hello!\n";
7.Using comma in a print statement
8.Mix the string the integer calculation in a print statement
9.Output the result of multiply with string
10.Output the result of division with string
11.Print only care about the first parenthesis
12.Put all into a parenthesis for print statement
13.Get the Power
14.Printing Output
15.Using Perl Built-in Functions
16.print function prints a string or a list of comma-separated words to the Perl filehandle STDOUT.
17.If the strings are not quoted, the filehandle STDOUT must be specified, or
18.The filehandle STDOUT must be specified if strings are not quoted.
19.Printing Numeric Literals
20.Printing String Literals
21.surrounding FINIS with single quotes
22.x 4 says that the text within the here document will be printed four times.
23.If terminator is in backquotes, will execute OS commands
24.Format text output with HTML tags
25.print 16 % 3;
26.print 2048 >> 3;
27.print 24 & 15;
28.print sqrt 4;
29.print -e STDIN; #Does STDIN exist?
30.print -t STDIN; #Is it tied to a terminal?
31.print -z STDIN; #Does it have zero size?
32.print $_ >= 0 ? $_ : -$_
33.print $_ < 10 ? $_ : "${\((a .. f)[$_ - 10])}\n";
34.print 1, 2, 3, 4, sort 9, 8, 7, 6, 5;
35.Print out here document
36.Syntax for the print Function
37.printf function prints a formatted string.
38.printf Flag Modifiers
39.Using the print Function