Howdy all,


For some reason I just can't get my modules imported into my CGI script and run in a browser. It will print the HTML fine in a command prompt call, but the browser gives an "Internal Error 500."

Error in Firefox & IE:


Server error!

The server encountered an internal error and was unable to complete your request.

Error message:
Attempt to reload functions.pm aborted. Compilation failed in require at C:/xampp/htdocs/interface.pl line 7. BEGIN failed--compilation aborted at C:/xampp/htdocs/interface.pl line 7. ,

If you think this is a server error, please contact the webmaster.
Error 500
localhost
3/26/2010 5:27:44 PM
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

Code:

#!perl -w

use strict;
use warnings;
use lib "R:/HPQ_SITLAB_TOOLS/Xgig";
use functions;
use CGI;

my ($query) = new CGI; 
print $query->header;
print $query->start_html("Xgig Test Configurator");
print "<H2>X-Gig Test Configurator</H2>\n";

&print_form($query);
&do_work($query) if ($query->param);

print $query->end_html;


####################   


sub print_form{
	my ($query) = @_;
	print $query->startform, "Please check the tests you would like execute:<br>";
	print $query->checkbox_group(-name=>'test_select',-values=>['Broadcast 1000','Identify 1000','Inquiry 1000'],-linebreak=>'true');
	print $query->submit('action','Select');
	print $query->defaults('Reset');
	print $query->endform;
	print "<HR>\n";
}

sub do_work{
	my ($query) =@_;
	my(@values , $key);
	print "<H2>Here are the tests you selected:</H2>";
	@values = $query->param('test_select');
	print join(", ",@values), "<br>";
	
	foreach my $test (@values){
		if ($test eq 'Broadcast 1000') {
			#&run_frunner;
		}
	}
}

If I comment out "use functions" and"&run_frunner" (a call to the functions package) it will display in a browser

Howdy all,

If I comment out "use functions" and"&run_frunner" (a call to the functions package) it will display in a browser

Based on that analysis, I would guess that there is an error in the run_frunner subroutine in your functions module-it could also have to do with how you called the subroutine-calling it with the '&' can produce some nasty, and usually unwanted, side effects.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.