in reply to Display the data passed from php

What do you mean by The contents of whole page is displayed in the browser?

Are the contents of the perl script displayed in the browser, insted of its output? If that's the case, you have a problem with the configuration of your webserver, not with perl.

And a general hint: to ease debugging of CGI scripts, start them with

#!/usr/bin/perl use warnings; use strict; use CGI::Carp qw(fatalsToBrowser);

And print the header as soon as you can.

Replies are listed 'Best First'.
Re^2: Display the data passed from php
by sandy1028 (Sexton) on Aug 20, 2007 at 09:15 UTC
    Yes the contents are displayed instead of output. Should I specify the path of cgi-bin where it is installed. Cgi-bin directory is in /var/www/cgi-bin which is the path of the server.
      With Apache you can configure any directory to serve perl CGI scripts, but you have to do that manually. (And you have to add the executable flag for the script).

      The apache doc is quite good, and there are many tutorials on the web.

      A reply falls below the community's threshold of quality. You may see it by logging in.

      The simplest way is to move the file to /var/www/cgi-bin and make it executable by doing

      $chmod +x

        Is there any other way to execute. In the configuration # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi pl Should this be uncommented so that the script works