Dear Sir,

     I have the error output as follows. Please help me!

Errors Output

Can't call method "finish" without a package or object reference at (eval 14) line 134.
, /usr/lib/perl5/site_perl/Apache/ASP.pm line 1083

Debug Output

STARTING ASP HANDLER (v0.15) for file /usr/local/apache/htdocs/asp/cpo.html
GlobalASA package Apache::ASP::Demo
compiling global.asa Apache::ASP::Demo
global.asa routines -
ASP object created - Application: ; GlobalASA: Apache::ASP::GlobalASA=HASH(0x81dad48); 
Internal: ; Request: Apache::ASP::Request=HASH(0x836221c);
Response: Apache::ASP::Response=HASH(0x8364a60); Server: 
Apache::ASP::Server=HASH(0x836b690); Session: ; allow_application_state: 1; app_start: 
0;
basename: cpo.html; buffering_on: 0; cgi_do_self: 0; cgi_headers: ; clean: 0; 
command_line: ; compile_error: ; compile_includes: ; cookie_path: /;
debug: 2; debugs_output: ARRAY(0x81dac88); dirname: /usr/local/apache/htdocs/asp; 
errors: 0; errors_output: ARRAY(0x831a77c); filehandle: ; filename:
/usr/local/apache/htdocs/asp/cpo.html; filter: 0; global: /tmp; global_package: 
Apache::ASP::Demo; group_refresh: 120; groups_refresh: 120; id:
NoCache; init_packages: ARRAY(0x8367b34); mail_alert_period: 20; mail_alert_to: ; 
mail_errors_to: ; mail_host: ; mtime: 974194149; no_cache: 1;
no_headers: 0; no_session: 0; no_state: 1; package: Apache::ASP::Demo; 
paranoid_session: 0; pod_comments: 1; r: Apache=SCALAR(0x83649ac); remote_i
p: 137.40.156.161; script_timeout: 90; secure_session: ; session_serialize: ; 
session_timeout: 1200; soft_redirect: ; stat_inc: 1; stat_inc_match:
zzz; state_cache: ; state_db: SDBM_File; state_dir: /tmp/asp_demo; state_manager: 10; 
ua: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95);
unique_packages: 0;
reloading - Tie/Hash.pm: /usr/lib/perl5/Tie/Hash.pm;
stat register of Apache/ASP.pm /usr/lib/perl5/site_perl/Apache/ASP.pm Apache::ASP
stat register of Config.pm /usr/lib/perl5/i386-linux/5.00404/Config.pm Config
stat register of Data/Dumper.pm /usr/lib/perl5/site_perl/Data/Dumper.pm Data::Dumper
stat register of lib.pm /usr/lib/perl5/lib.pm lib
stat register of Fcntl.pm /usr/lib/perl5/i386-linux/5.00404/Fcntl.pm Fcntl
stat register of strict.pm /usr/lib/perl5/strict.pm strict
stat register of Exporter.pm /usr/lib/perl5/Exporter.pm Exporter
stat register of overload.pm /usr/lib/perl5/i386-linux/5.00404/overload.pm overload
stat register of vars.pm /usr/lib/perl5/vars.pm vars
stat register of Cwd.pm /usr/lib/perl5/Cwd.pm Cwd
stat register of Apache/Connection.pm /usr/lib/perl5/site_perl/Apache/Connection.pm 
Apache::Connection
skipping StatINC register of Apache
stat register of DynaLoader.pm /usr/lib/perl5/i386-linux/5.00404/DynaLoader.pm 
DynaLoader
stat register of SDBM_File.pm /usr/lib/perl5/i386-linux/5.00404/SDBM_File.pm SDBM_File
stat register of MD5.pm /usr/lib/perl5/site_perl/MD5.pm MD5
stat register of Carp.pm /usr/lib/perl5/Carp.pm Carp
stat register of Apache/Symbol.pm /usr/lib/perl5/site_perl/Apache/Symbol.pm 
Apache::Symbol
stat register of Apache/Server.pm /usr/lib/perl5/site_perl/Apache/Server.pm 
Apache::Server
stat register of Time/Local.pm /usr/lib/perl5/Time/Local.pm Time::Local
stat register of Class/Struct.pm /usr/lib/perl5/Class/Struct.pm Class::Struct
stat register of File/stat.pm /usr/lib/perl5/File/stat.pm File::stat
stat register of File/Basename.pm /usr/lib/perl5/i386-linux/5.00404/File/Basename.pm 
File::Basename
stat register of MLDBM.pm /usr/lib/perl5/site_perl/MLDBM.pm MLDBM
stat register of HTTP/Date.pm /usr/lib/perl5/site_perl/HTTP/Date.pm HTTP::Date
stat register of Devel/Symdump.pm /usr/lib/perl5/site_perl/Devel/Symdump.pm 
Devel::Symdump
skipping StatINC register of Apache::Constants
stat register of AutoLoader.pm /usr/lib/perl5/AutoLoader.pm AutoLoader
stat register of mod_perl.pm /usr/lib/perl5/site_perl/mod_perl.pm mod_perl
stat register of Apache/Constants/Exports.pm 
/usr/lib/perl5/site_perl/Apache/Constants/Exports.pm Apache::Constants::Exports
stat register of Tie/Hash.pm /usr/lib/perl5/Tie/Hash.pm Tie::Hash
stat register of Tie/Hash.pm /usr/lib/perl5/Tie/Hash.pm Tie::Hash
parsing cpo.html
inlining include header.inc
undefing sub Apache::ASP::Demo::NoCache active code CODE(0x83b9f2c) before compiling
compiling into package Apache::ASP::Demo subid Apache::ASP::Demo::NoCache
reloading - DemoASP.pm: DemoASP.pm;
stat register of DBI.pm /usr/lib/perl5/site_perl/DBI.pm DBI
stat register of DemoASP.pm DemoASP.pm DemoASP
stat register of DemoASP.pm DemoASP.pm DemoASP
Script_OnStart
compiled -
executing NoCache
Can't call method "finish" without a package or object reference at (eval 14) line 134.
, /usr/lib/perl5/site_perl/Apache/ASP.pm line 1083
Script_OnEnd
compiled -

ASP to Perl Program

  1: package Apache::ASP::Demo;  ;; no strict; ;; use vars qw($Application $Session 
$Response $Server $Request); ;; sub Apache::ASP::Demo::NoCache {
;;  return(1) unless $_[0]; @_ = (); ;;
  2: use DBI;
  3: $Response->Write('
  4: ');
  5:      use DemoASP;
  6:      $demo = &DemoASP::new;
  7: $Response->Write('
  8: <html>
  9: <head><title>'.($demo->{title}).'</title></head>
 10: <body bgcolor='.($_[0] || $demo->{bgcolor}).'>
 11:
 12:
 13: <form method=POST>
 14: <font size=+1> Please enter the following information: </font><br>
 15:      <font>Customer Code: </font><input name=customer type=text size=30 
value="'.($Request->Form('customer')).'" >
 16: <br>
 17:      <font>Password: </font><input name=password type = password size=30 
value="'.($Request->Form('password')).'" >
 18: <br><BR><BR>
 19:
 20: <font size=+1>Please choose either one of the function: </font><br>
 21:      <INPUT TYPE=RADIO NAME=radio VALUE="1" CHECKED><font>Outstanding Purchase 
Order</font>
 22: <br>
 23:      <INPUT TYPE=RADIO NAME=radio VALUE="2" ><font>Stock Information of Model: 
</font>
 24: <input name=model type = text size=30 value="'.($Request->Form('model')).'" >
 25: <br><br><br>
 26: <center>
 27: <INPUT TYPE="SUBMIT" VALUE="Submit">
 28: </center>
 29:
 30:
 31:
 32: '); if($Request->Form('customer'))
 33: { my $customer=uc($Request->Form('customer'));
 34: $Response->Write('
 35:
 36: '); if($Request->Form('password') !=123)
 37: { $Response->Write('
 38: <font color=red>Invalid Password!!!</font>
 39:
 40: ');} else { $Response->Write('
 41:
 42: '); if($Request->Form('radio') ==1 )
 43:  {
 44: $Response->Write('
 45: ');
 46: $DBH = DBI->connect('dbi:mysql:www', 'test', '');
 47:
 48: $sth = $DBH->prepare("SELECT count(*) FROM cpo_hdr WHERE cpoh_cust_code =
 49: '$customer'")
 50:      || die $DBH->errstr;
 51: $sth->execute() || die $sth->errstr;
 52: while (my @row = $sth->fetchrow) {
 53:  $Response->Write('
 54: ');if ($row[0] ==0) {$Response->Write('
 55: <font color=red>Invalid Customer/No oustanding P.O.!!!</font><br>
 56: '); } else { $Response->Write('
 57: <font size =+1>Customer : </font>'.($customer).' <br>
 58: ');} $Response->Write('
 59: ');} $Response->Write('
 60:
 61:
 62:
 63: ');
 64: $sth = $DBH->prepare("SELECT cpoh_our_ref, cpoh_cust_cpo_no,
 65: cpoi_model_no, cpoi_cust_model, cpoi_outstd_qty, cpoi_dly_date
 66: FROM cpo_hdr, cpo_itm
 67: WHERE cpoh_cust_code = '$customer' and cpoh_status = 'N'
 68: and cpoh_our_ref = cpoi_our_ref")
 69:      || die $DBH->errstr;
 70: $sth->execute() || die $sth->errstr;
 71: my $prev = 0;
 72: while (my @row = $sth->fetchrow) {
 73:  $Response->Write('
 74: '); if ($prev != $row[0]) {$Response->Write('
 75: <hr>
 76: <font size=+1>Order No. : </font>'.($row[1]).'
 77: <br>
 78: <table COLS=4 WIDTH="100%" >
 79: <tr>
 80: <td width ="25%"><b>Model No.</b></td><td width ="25%"><b>Customer Model Ref. 
</b></td>
 81: <td width ="25%"><b>Outstanding Qty </b></td><td width ="25%"><b>Delivery 
Schedule</b></td>
 82: </table>
 83: ');$prev = $row[0];
 84: } $Response->Write('
 85: <table COLS=4 WIDTH="100%" >
 86: <tr>
 87: <td width ="25%">'.($row[2]).'</td><td width ="25%">'.($row[3]).'</td><td width 
="25%">'.($row[4]).'</td><td width ="25%">'.($row[5]).'</td>
 88: </table>
 89:
 90: ');}$Response->Write('
 91: ');}$Response->Write('
 92: <table COLS=4 WIDTH="100%" >
 93: </table>
 94:
 95:
 96: '); if($Request->Form('radio') ==2 )
 97: { my $model=uc($Request->Form('model'));
 98: $Response->Write('
 99: ');
100: $DBH = DBI->connect('dbi:mysql:www', 'test', '');
101:
102: $sth = $DBH->prepare("SELECT count(*) FROM stock WHERE stk_model_no =
103: '$model'")
104:      || die $DBH->errstr;
105: $sth->execute() || die $sth->errstr;
106: while (my @row = $sth->fetchrow) {
107:  $Response->Write('
108: ');if ($row[0] ==0) {$Response->Write('
109: <font color=red>No stock!!!</font>
110: '); } else { $Response->Write('
111: <br>
112: <font size =+1>Product Availability</font>
113: <hr>
114: <table COLS=2 WIDTH="100%" >
115: <tr>
116: <td><b>Model No.</b></td><td><b>Available Quantity </b></td>
117: </table>
118: ');} $Response->Write('
119: ');} $Response->Write('
120:
121:
122: ');
123: $sth = $DBH->prepare("SELECT stk_model_no, stk_balance FROM stock WHERE 
stk_model_no =
124: '$model'")
125:      || die $DBH->errstr;
126: $sth->execute() || die $sth->errstr;
127: while (my @row = $sth->fetchrow) {
128:  $Response->Write('
129: <table COLS=2 WIDTH="100%" >
130: <tr>
131: <td>'.($row[0]).'</td><td>'.($row[1]).'</td>
132: </table>
133: <br>
134:
135: ');}$Response->Write('
136: ');}$Response->Write('
137:
138: ');}$Response->Write('
139:
140: ');
141: }
142: $sth->finish;
143:  ;; }


Reply via email to