Re: [PBML] Re: Calling a shell script from perl
>>>>> "Damien" == Damien Carbery <daymobrew@...> writes:Damien> To call a shell script you can use the 'system' function. This will
Damien> allow you to display the results in the browser. Use backticks if you
Damien> want to capture and process the results, or if you want to discard them.
Damien> For the log file reading, you could use 'tail' (or a module that does
Damien> the same). You can use NPH (Non-Parsed Header) to continuously send
Damien> data to the browser. A simpler alternative method would be code in the
Damien> HTTP header telling the browser to call the script again after a
Damien> specified period (5 secs in this example) i.e. META
Damien> HTTP-EQUIV="Refresh" CONTENTS="5; URL=your_script.cgi"
I have an example of doing that (launching a command, then
watching its output) at:
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!