tari_tfk has asked for the wisdom of the Perl Monks concerning the following question:

How I can make my Perl program executable and accessible from the browser I very new in this environments (I am running mod_perl on the top of apache on the top of unix ) its a very simple one like helloWorld.pl

Replies are listed 'Best First'.
Re: abc HELP
by higle (Chaplain) on Sep 11, 2001 at 23:05 UTC
    Also, make sure that the .pl file that you're going to run has the proper permissions set. Generally speaking, if you run a chmod 0755 on the file, that is good enough for most purposes. If you don't, your file won't run.

    Also, if you plan to print output to a browser, be sure to put the line print "Content-type: text/html\n"; in before any other print statements, or the browser won't understand in which format to display the content!

    Hope this helps...
    higle
      Also, if you get more in depth with CGI programming, check out CGI.pm because it is a VERY useful module, that comes with Perl anyways, and is used mainly for if you start to work with CGI forms. It also can parse, and do a ton of other useful stuff, but just check out the documentation s/if/when you decide to use it!

      Hope this helps!

      Andy Summers
Re: abc HELP
by dragonchild (Archbishop) on Sep 11, 2001 at 19:05 UTC
    You should have a cgi-bin directory set up through apache. Put the script in there and just have the URL be www.mymachine.com/cgi-bin/HelloWorld.pl and that should work just fine.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Re: abc HELP
by tachyon (Chancellor) on Sep 12, 2001 at 10:02 UTC

    See my CGI Help Guide for a good rundown. You will also probably get some good mileage from New Monks or if you like it really brief New Monks Info Page

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print