[thelist] Perl question: problems calling a sub_routine

Tony Grimes algrimes at acs.ucalgary.ca
Thu Feb 22 06:13:14 CST 2001


A question for the perl mongers:

I'm creating an HTML output by printing it as one block (I don't know the
proper term) like this:

print <<END_OF_HTML;
Content-type: text/html

<HTML>
...
</HTML>
END_OF_HTML

I'm having no problem having variables resolved within the block, but how
do I call a subroutine? For example, I want to use code similar to this:

print <<END_OF_HTML;
Content-type: text/html

<HTML>
<BODY>
...
Some text that appears in the webpage call_sub_routine(@array_variable).
...
</BODY>
</HTML>
END_OF_HTML

Only the array variable seems to be recognized. For example, this appears
in the outputed webpage:

...appears in the webpage call_sub_routine(element1, element2, etc).

I don't want to resort to using individual print statements (being as lazy
as I am), so is there any way to call a subroutine using this print
method? Any help would be much appreciated. FYI, the subroutine is a
variation of Recipe 4.2 in the Perl Cookbook. TIA.

.tony







More information about the thelist mailing list