Active Client Pages at the Server - Using Perl to send a string to the client
(Page 3 of 4 )
The Perl file called by the client, in its simplest form, is as follows:
$sendStr = qq{
#HTML page and JavaScripts without escaping the entities
};
print $sendStr;
You have the quoting operator, named qq{}. Whatever is in the {} brackets is considered a string. You do not need to escape any entity in the qq{} operator.
There are two Perl statements here: the one for the quoting operator and “print $returnStr;”. This last statement returns the string to the browser at the client.
In this simple example, the string in the qq{} operator is a web page, made up of HTML elements and JavaScripts. The browser can use this string without modification to produce a new page. This string can actually be anything which the JavaScript at the client can handle.
You can have more Perl statements than I've shown in this example; however, the statements must all work to produce the string.
Next: Obtaining a string from any file in any directory at the server >>
More JavaScript Articles
More By Chrysanthus Forcha