Re: fedora apache cgi-perl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thibaut wrote:
Hi,

I try to run a perl script in my webserver. Therefore I put a script in the /var/www/cgi-bin/ directory. I have put the 777 permission on it. Here is the script :

#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "<html><head><title>Hello World!! </title></head>\n";
print "<body><h1>Hello world</h1></body></html>\n";


The hard way:

#!/usr/bin/perl -w

print "Content-type: text/html
Pragma: no-cache

<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"
       \"http://www.w3.org/TR/REC-html40/loose.dtd\";>
<HTML><HEAD>
<TITLE>Hello World</TITLE>
</HEAD><BODY>
</BODY></HTML>";

The 'better way, from the CGI man page:

#!/usr/bin/perl -w

use CGI;
use strict;

my $q = new CGI;

print $q->header,                    # create the HTTP header
       $q->start_html('hello world'), # start the HTML
       $q->h1('hello world'),         # level 1 header
       $q->end_html;                  # end the HTML



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux