httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sabherwal, Balvinder (MBS)" <Balvinder.Sabher...@mortgagefamily.com>
Subject RE: Internal Error
Date Tue, 15 Jan 2002 17:40:22 GMT
> Here is the script, its a perl script and has the interpreter specified on
> its first line.
> 
> #!c:/perl/bin/perl.exe
> push(@INC,'c:\program files/apache group/apache/cgi-bin');
> use testapi;
> #require('c:\program files/apache group/apache/cgi-bin/testapi.pm');
> my $webapp = "testapi"->new();
> $webapp->run();
> 

> So really, you are executing the run() method in testapi.pm. What does
> it do?

testapi.pm is as below:

package testapi;
use base 'CGI::Application';
use strict;

   # Needed for our database connection
   use DBI;

   sub setup {
	my $self = shift;
	$self->start_mode('mode1');
	$self->run_modes(
		'mode1' => 'showapps',
		'mode2' => 'showyear',
		'mode3' => 'showdates',
		'mode4' => 'showdetails'
	);

   }

   sub teardown {
	my $self = shift;

   }

   sub showapps {
	my $self = shift;
	# Get CGI query object
	my $q = $self->query();
	my $startloc="e:\it support services\db
architecture\sybase\sysmon-webdb";
	opendir(SMD,"$startloc") || die "Failed to open Sysmon DB";
	my @apps;

	@apps = grep {$_ !~ m/^\.{1,2}$/} readdir(SMD);

	closedir(SMD);

	my $output = '';
	$output .= $q->start_html(-title => 'Sysmon Database');
	$output .= $q->start_form();
	$output .= $q->popup_menu(-name=> 'apps', -values =>\@apps);
	$output .= $q->hidden(-name => 'rm', -value => 'mode2');
	$output .= $q->submit();
	$output .= $q->end_form();
	$output .= $q->end_html();

	return $output;
   }

   sub showlist {
	my $self = shift;

 	#Get CGI query object
	my $q = $self->query();
	my $testcode = $q->param("testcode");
	my $output = '';
	$output .= $q->start_html(-title => 'List of Matching tests');
	$output .= $q->end_html();
	return $output;
   }

   sub showdetail {
	my $self = shift;

	# Get CGI query object
	my $q = $self->query();
	my $testid = $q->param("testid");

	my $output = '';
	$output .= $q->start_html(-title => 'test Detail');

	$output .= $q->end_html();

	return $output;
   }

1;

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message