modperl£¬
       I have pkg_add mod_perl and apache_1.3.12.tgz and so on.
but I happen a question on visiting http://localhost/asp/site/eg/index.html
       please help me.thanks.

Errors Output

> %EG is not defined, make sure you copied ./eg/global.asa correctly at (eval 8) line 
>5.
, /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1229

Debug Output

> RUN ASP (v0.18) for /usr/local/www/data/asp/site/eg/index.html
> GlobalASA package Apache::ASP::Demo
> ASP object created - GlobalASA: Apache::ASP::GlobalASA=HASH(0x8353348); Request: 
>Apache::ASP::Request=HASH(0x831c730); Response: 
>Apache::ASP::Response=HASH(0x831c634); Server: Apache::ASP::Server=HASH(0x831c508); 
>basename: index.html; compile_includes: 1; dbg: 2; debugs_output: ARRAY(0x81bb83c); 
>filename: /usr/local/www/data/asp/site/eg/index.html; global: /tmp; global_package: 
>Apache::ASP::Demo; id: NoCache; includes_dir: ; init_packages: ARRAY(0x8286114); 
>no_cache: 1; no_state: 1; package: Apache::ASP::Demo; pod_comments: 1; r: 
>Apache=SCALAR(0x839f718); sig_warn: ; stat_inc: ; stat_inc_match: ; stat_scripts: 1; 
>unique_packages: ; use_strict: ;
> parsing index.html
> runtime exec of dynamic include header.inc args ()
> parsing header.inc
> loaded module Apache::Symbol
> active undefing sub Apache::ASP::Demo::_tmp_header_inc code CODE(0x81fedbc)
> compile include header.inc sub _tmp_header_inc
> runtime exec of dynamic include footer.inc args ()
> parsing footer.inc
> active undefing sub Apache::ASP::Demo::_tmp_footer_inc code CODE(0x83b255c)
> compile include footer.inc sub _tmp_footer_inc
> active undefing sub Apache::ASP::Demo::NoCache code CODE(0x83b2688)
> compiling into package Apache::ASP::Demo subid Apache::ASP::Demo::NoCache
> executing NoCache
> %EG is not defined, make sure you copied ./eg/global.asa correctly at (eval 8) line 
>5.
, /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1229

ASP to Perl Program

  1: package Apache::ASP::Demo; ;; sub Apache::ASP::Demo::NoCache {  ;;  return(1) 
unless $_[0];  ;; no strict;;use vars qw($Application $Session $Response $Server 
$Request);;
  2: # split the page in 2 for nice formatting and english style sorting
  3: my(@col1, @col2);
  4: my @keys = sort keys %EG;
  5: @keys || die("\%EG is not defined, make sure you copied ./eg/global.asa 
correctly");
  6: my $half = int(@keys/2) + 1;
  7:
  8: for(my $i =0; $i <= $#keys; $i++) {
  9:    if($i < $half) {
 10:            push(@col1, $keys[$i]);
 11:    } else {
 12:            push(@col2, $keys[$i]);
 13:    }
 14: }
 15: $Response->Debug('col1', \@col1, 'col2', \@col2);
 16: $title = 'Example ASP Scripts';
 17: $Response->Write('
 18:
 19: '); $Response->Include('header.inc', ); $Response->Write('
 20:
 21: <table border=0>
 22: '); while(@col1) {
 23:    my $col1 = shift @col1;
 24:    my $col2 = shift @col2;
 25:    $Response->Write('
 26:    <tr>
 27:    '); for([$col1, $EG{$col1}], '', [$col2, $EG{$col2}]) {
 28:            unless(ref $_) {
 29:                    print "<td width=10>&nbsp;</td>";
 30:                    next;
 31:            }
 32:            next unless $_->[0]; # last col / last row
 33:
 34:            # clean up the descriptions
 35:            $_->[1] =~ s/\s*\.\s*$//s;
 36:            $_->[1] .= '.';
 37:
 38:            $Response->Write('
 39:            <td valign=top>
 40:                    <nobr>
 41:                    <font size=-0>
 42:                            <tt><b>
 43:                            <a href='.($_->[0]).'>'.($_->[0]).'</a>
 44:                            '); if($_->[0] =~ /\.(htm|asp|ssi|xml)$/) { 
$Response->Write('
 45:                                    &nbsp
 46:                                    <i>
 47:                                    (<a 
href=source.asp?file='.($_->[0]).'>source</a>)
 48:                                    </i>
 49:                            '); } $Response->Write('
 50:                            </tt></b>
 51:                    </font>
 52:                    </nobr>
 53:                    <br>
 54:                    <font size=-1>'.($_->[1]).'</font>                      
 55:            </td>
 56:    '); } $Response->Write('
 57:    </tr>
 58: '); } $Response->Write('
 59: </table>
 60:
 61: '); $Response->Include('footer.inc', );  ;; }




            jsquan
            [EMAIL PROTECTED]

Reply via email to