# Calling a Perl Script from within a Perl Script
# Version 1.0
# Perlcall README File
# By Mike Calabrese
# http://www.mikecalabrese.com
# 07-26-2003
# This application is available for free on an AS-IS basis. I am not
# responsible for consequential damages, loss of income or whatever
# else that may happen as a result of the use of this program.
This is a snippit of code that will call a Perl Script from within a
Perl Script. It was originally written so the the Ad Banner Rotator
Program, found on mikecalabrese.com, could be called from within a Perl
Script. However, I soon discovered that this will also call other programs,
including the Site Last Updated Program, found on mikecalabrese.com . It
should work with a number of Perl Scripts as long as additional parameters
don't need to be passed.
The way that this code works is that the result of a call to a given Perl
Script is set to a variable. That variable is then given out within the
context of a Perl based web page.
If you are using this code within a Perl based web page that has print
statements on every line, simply insert the 4 lines of code where you
want the output to appear. If you are using "Here Document Syntax" or
statements like this before and after the HTML within a Perl Script:
(A bunch of Perl stuff)
print <<"HTMLDOC";
(A bunch of HTML stuff)
HTMLDOC
(Possibly some more Perl stuff)
you must place a string terminator (in this case, HTMLDOC, or whatever you
want to call it) before the 4 lines of code. Then, after the 4 lines of
code, you must place a starting delimiter line (in this case,
print <<"HTMLDOC";).
Please note that this is not a stand alone application but merely a snippit
of code that can be placed within a Perl Script. This code has been
successfully tested in UNIX and Linux environments.