I have a plain perl script that can be run from the command-line via perl -w test.pl
. I then have a mod_perl2 script that can be accessed from a web browser. I want to have the latter call the former and send the output to the browser, flushing as it goes.
The mp2 script doesn't have a shebang line, because it's mod_perl, so it doesn't know where perl
lives. Also, calling system('perl -w c:\\path\\to\\test.pl')
results in the error:
'perl' is not recognized as an internal or external command, operable program or batch file.
for some reason I can't figure out, since it's in my path variable. Maybe not for the account Apache is running under.
Is there some way to run the script and capture its output without calling the perl executable via system()
? I.e., something that uses the interpreter that's already loaded?