Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Simple Perl print() output redirect to html/webpage.

by aitap (Deacon)
on Sep 03, 2012 at 07:59 UTC ( #991376=note: print w/ replies, xml ) Need Help??


in reply to Simple Perl print() output redirect to html/webpage.

If you need to write everything thet print writes to a file, use select:

open my $html, ">", /srv/www/mystatus.htm; select $html;
If you want to call your Perl script from a webserver, you need to use CGI or CGI::Simple.

Please specify what exactly you want.

Sorry if my advice was wrong.


Comment on Re: Simple Perl print() output redirect to html/webpage.
Download Code
Replies are listed 'Best First'.
Re^2: Simple Perl print() output redirect to html/webpage.
by hmb104 (Sexton) on Sep 03, 2012 at 17:48 UTC

    My problem with using PHP passthru() is that it uses the user nobody to execute. The user nobody doesn't have write access & also PGP will not work with nobody and it is not recommended to give such access to nobody.

    My script returns 6 lines of print() statements, I dont want to make it a CGI script and add all the CGI related info to it. Can I create another CGI script and call it from within just to print my lines?

      Can I create another CGI script and call it from within just to print my lines?
      Why not? You can use the backtick operator or do + Capture::Tiny to get the stdout of your script.
      Sorry if my advice was wrong.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991376]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2015-07-28 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls