Make Apache recognize Perl!
May 28, 2008 5:49 AM Subscribe
How can I get my web server to interpret perl
I am playing around with perl for the first time in my life. I am using a fedora core 8 machine. It seems to ave all the essentials installed already (apache, php, mySQL, and perl). However, I make a file called perl.pl and it does not seem to translate correctly. Here is what is in the file:
#!/usr/bin/perl
print "Content-type: text/html \n\n"; #HTTP HEADER
# DEFINE SOME SCALAR VARIABLES
$number = "5";
$exponent = "2 ** 8";
$string = "Hello, PERL!";
$stringpart_1 = "Hello, ";
$stringpart_2 = "PERL!";
$linebreak = "
"; #HTML LINEBREAK TAG
# PRINT THEM TO THE BROWSER
print $number;
print $linebreak;
print $exponent;
print $linebreak;
print $string.$linebreak;
print $stringpart_1.$stringpart_2;
When you go the the browser, you see the following
http://[ip address]/perl/perl.pl
As you can see, you prints out exactly what I type. Am I doing anything wrong? Am I suppose to enable a perl service or change a configuration file?
posted by kaozity to computers & internet (7 answers total)
posted by cdmwebs at 5:54 AM on May 28, 2008