I have a perl file that contains some regular expressions, and I want to make it into a CGI script. Can something like this run on the web so that when the user points to it with their browser it will execute the perl file and deliver the results of the search and replace? Every time I try it gives the message "Internal Server Error."
Below is a shortened version of my file:
#!/usr/bin/perl -w
use CGI qwstandard);
print "Content-type: text/html\n\n";
use diagnostics -verbose;
use warnings 'all';
#use re 'debugcolor';
package XMLtoRDFConverter;
#input XML elements:
$e = "
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE #... more xml stuff...
";
if ($e =~ m/<!DOCTYPE/)
{$e =~ s/<!DOCTYPE(.*?)>//s;
print ("");}
else {print ("no doc type declaration\n");}
#more regular expressions...
open FH,">rd.txt" or die $!;
print FH $e;
print ("$e\n");
Below is a shortened version of my file:
#!/usr/bin/perl -w
use CGI qwstandard);
print "Content-type: text/html\n\n";
use diagnostics -verbose;
use warnings 'all';
#use re 'debugcolor';
package XMLtoRDFConverter;
#input XML elements:
$e = "
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE #... more xml stuff...
";
if ($e =~ m/<!DOCTYPE/)
{$e =~ s/<!DOCTYPE(.*?)>//s;
print ("");}
else {print ("no doc type declaration\n");}
#more regular expressions...
open FH,">rd.txt" or die $!;
print FH $e;
print ("$e\n");