You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Scott Chapman <sc...@mischko.com> on 2001/11/08 03:01:39 UTC

Still having problems with visibility of subroutine - long.

I'm sorry to bother the list again but I'm missing something here.  I 
tried Andrew's suggestion and got it working some of the time and 
not some of the time (as if the caching of perl pseudo code was 
causing it to not reflect my changes).  I stopped apache and 
restarted it (assuming that will clear all caching) and here's what I'm 
getting consistently now:

Here's what I'm getting on the web page,followed by new_review.epl (the page called when this happened), base.epl, subs.epl, and the logfile entries.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@laptop.mischko.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

[4800]ERR: 24: Line 1: Error in Perl code: Undefined subroutine &HTML::Embperl::DOC::_2::log_event called at /wwww/htdocs/new_review.epl line 29.

Apache/1.3.20 (Unix) mod_perl/1.26 HTML::Embperl 2.0b3 [Wed Nov 7 17:56:18 2001]

================ new_review.epl:

<HTML>
<HEAD>
<TITLE>Process Annual Review request</TITLE>
</HEAD>
<BODY>

[-
    
  # Get data that EmbperlObject makes available to all web pages 

    $req = shift;

  # EmbperlObject has us already connected to the database.
  # Get new Annual Review number from database.

    my ($sth) = $req->{dbh}->prepare ("select ar_num.NEXTVAL from DUAL");
    $sth->execute();
    $review_num = $sth->fetchrow_array;

  # Generate random directory name to hold this new review.
  # Make sure it doesn't already exist and make the new directory.

    @chars = ( "a" .. "z" );
    $dir_name='';
    do {
        $dir_name = join("", @chars[ map { rand @chars } ( 1 .. 8 ) ]);
    } until (! -e "/wwww/htdocs/$dir_name");
    mkdir("/wwww/htdocs/$dir_name", 0700) || die "Cannot mkdir newdir: $!";
    
    log_event ($review_num,'ReviewDirectory',$dir_name);

  # Store the Annual Review number in "reviewnum.dat" file in the new directory

    open(REVNUM_FILE, "> $dir_name/reviewnum.dat")
        or die "Couldn't open $dir_name/reviewnum.dat for writing: $!\n";
    print (REVNUM_FILE $review_num);
    close (REVNUM_FILE);
  
  # Make symlinks to all the processing files in the directory above the new directory.
  # This way the files will be accessed as if they were in the new directory and .htaccess
  # restrictions will apply.
  
  # Determine the type of review from data submitted in the previous form and symlink the quest.epl 
  # file in the new directory to the appropriate questionairre file in the directory above.
  
    if ("$fdat{review_type}" eq "MPE") 
        {symlink("/wwww/htdocs/mpe_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";} 
    elsif ("$fdat{review_type}" eq "HPUX") 
        {symlink("/wwww/htdocs/hpux_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";} 
    elsif ("$fdat{review_type}" eq "SOLARIS") 
        {symlink("/wwww/htdocs/solaris_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";} 
    elsif ("$fdat{review_type}" eq "LINUX") 
        {symlink("/wwww/htdocs/linux_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";}

  # symlink the upload form
  
  # symlink the final page
  
  # create username and password
  
  # add user to password file
  
  # create .htaccess file
  
    log_event ($review_num,'CreateReview',$fdat{review_type});
    
  # direct the user to the questionairre
  

-]

</BODY>
</HTML>

================ base.epl:

<HTML>
	[- Execute ('constants.epl') -]
	[- Execute ('init.epl') -]
        [- Execute ({ inputfile => 'subs.epl', import => 1}) -]
<HEAD>
	[- Execute ('head.epl') -]
</HEAD>
<BODY>
	[- Execute ('*') -]
</BODY>
	[- Execute ('cleanup.epl') -]
</HTML>
================ subs.epl:

[-
  # logs events to the database.
  sub log_event
  {
      $review_num = shift;
      $event = shift;
      $info = shift;
      if (!defined $req_rec -> connection -> user) {
          $user="nobody";
      } else {
          $user=$req_rec -> connection -> user;
      }
      $req->{dbh}->do("INSERT INTO ar_events VALUES ($review_num,time(),'$event','$user','$info')");
  }

-]

================ Logfile:

Logfile = /tmp/embperl.log, Position = 1808543, Pid = 4800
[4800]REQ: Embperl 2.0b3 starting... Wed Nov 7 17:56:17 2001

[4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
[4800]REQ: Package = HTML::Embperl::DOC::_1
[4800]Formdata... length = 15
[4800]FORM: review_type=MPE
[4800]Using APACHE for output...
[4800]CACHE: SvTYPE (*ppSV) = 7
[4800]CACHE: SvTYPE (*ppSV) = 12
[4800]CACHE: SvTYPE (*ppSV) = 7
[4800]CACHE: SvTYPE (*ppSV) = 12
[4800]EVAL< <unknown>
[4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
[4800]MEM: Load /wwww/htdocs/constants.epl in HTML::Embperl::DOC::_3
[4800]CACHE: New File for '/wwww/htdocs/constants.epl' (83b6e90) in 'HTML::Embperl::DOC::_3' hash cache-key '/wwww/htdocs/constants.epl'
[4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
[4800]REQ: Package = HTML::Embperl::DOC::_3
[4800]Reading /wwww/htdocs/constants.epl as input using PerlIO ...
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Parse Start Time: 10 ms 
[4800]PERF: Parse End Time: 10 ms 
[4800]PERF: Parse Time: 0 ms 
[4800]PERF: DOMSTAT: MemUsage = 69684 Bytes numNodes = 29 numStr = 92 numReplace = 5 
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Compile Start Time: 10 ms 
[4800]PERF: Compile End Time: 20 ms 
[4800]PERF: After Compile Exec End Time: 20 ms 
[4800]PERF: Perl Compile End Time: 20 ms 
[4800]PERF: Compile Time: 10 ms 
[4800]PERF: DOMSTAT: MemUsage = 69684 Bytes numNodes = 27 numStr = 92 numReplace = 5 
[4800]CACHE: SvTYPE (*ppSV) = 7
[4800]CACHE: SvTYPE (*ppSV) = 12
[4800]EVAL< <unknown>
[4800]EVAL> <undefined>
[4800]PERF: Run Start Time: 20 ms 
[4800]PERF: Run End Time: 20 ms 
[4800]PERF: Run Time: 0 ms 
[4800]PERF: DOMSTAT: MemUsage = 71804 Bytes numNodes = 28 numStr = 92 numReplace = 5 
[4800]PERF: input = /wwww/htdocs/constants.epl
[4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
[4800]Sub-Request finished. Wed Nov 7 17:56:17 2001
. Entry-SVs: 17110 -OBJs: 16 Exit-SVs: 17317 -OBJs: 18
[4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
[4800]MEM: Load /wwww/htdocs/init.epl in HTML::Embperl::DOC::_4
[4800]CACHE: New File for '/wwww/htdocs/init.epl' (83b6988) in 'HTML::Embperl::DOC::_4' hash cache-key '/wwww/htdocs/init.epl'
[4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
[4800]REQ: Package = HTML::Embperl::DOC::_4
[4800]Reading /wwww/htdocs/init.epl as input using PerlIO ...
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Parse Start Time: 10 ms 
[4800]PERF: Parse End Time: 10 ms 
[4800]PERF: Parse Time: 0 ms 
[4800]PERF: DOMSTAT: MemUsage = 75936 Bytes numNodes = 38 numStr = 94 numReplace = 5 
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Compile Start Time: 10 ms 
[4800]PERF: Compile End Time: 20 ms 
[4800]PERF: After Compile Exec End Time: 20 ms 
[4800]PERF: Perl Compile End Time: 240 ms 
[4800]PERF: Compile Time: 230 ms 
[4800]PERF: DOMSTAT: MemUsage = 75936 Bytes numNodes = 36 numStr = 94 numReplace = 5 
[4800]CACHE: SvTYPE (*ppSV) = 7
[4800]CACHE: SvTYPE (*ppSV) = 12
[4800]EVAL< <unknown>
[4800]EVAL> <undefined>
[4800]PERF: Run Start Time: 240 ms 
[4800]PERF: Run End Time: 940 ms 
[4800]PERF: Run Time: 700 ms 
[4800]PERF: DOMSTAT: MemUsage = 78056 Bytes numNodes = 37 numStr = 94 numReplace = 5 
[4800]PERF: input = /wwww/htdocs/init.epl
[4800]PERF: Time: 940 ms Evals: 0 No Evals to cache
[4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
. Entry-SVs: 17332 -OBJs: 19 Exit-SVs: 28842 -OBJs: 32
[4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
[4800]MEM: Load /wwww/htdocs/subs.epl in HTML::Embperl::DOC::_5
[4800]CACHE: New File for '/wwww/htdocs/subs.epl' (83bd8d0) in 'HTML::Embperl::DOC::_5' hash cache-key '/wwww/htdocs/subs.epl'
[4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
[4800]REQ: Package = HTML::Embperl::DOC::_5
[4800]Reading /wwww/htdocs/subs.epl as input using PerlIO ...
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Parse Start Time: 10 ms 
[4800]PERF: Parse End Time: 10 ms 
[4800]PERF: Parse Time: 0 ms 
[4800]PERF: DOMSTAT: MemUsage = 81160 Bytes numNodes = 44 numStr = 96 numReplace = 5 
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Compile Start Time: 10 ms 
[4800]PERF: Compile End Time: 10 ms 
[4800]PERF: After Compile Exec End Time: 10 ms 
[4800]PERF: Perl Compile End Time: 20 ms 
[4800]PERF: Compile Time: 10 ms 
[4800]PERF: DOMSTAT: MemUsage = 81160 Bytes numNodes = 43 numStr = 96 numReplace = 5 
[4800]PERF: input = /wwww/htdocs/subs.epl
[4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
[4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
. Entry-SVs: 28843 -OBJs: 33 Exit-SVs: 29070 -OBJs: 34
[4800]IMP: Create Imports for HTML::Embperl::DOC::_1 from HTML::Embperl::DOC::_5 (HASH(0x85595f4))
[4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
[4800]MEM: Load /wwww/htdocs/head.epl in HTML::Embperl::DOC::_6
[4800]CACHE: New File for '/wwww/htdocs/head.epl' (83ce8b8) in 'HTML::Embperl::DOC::_6' hash cache-key '/wwww/htdocs/head.epl'
[4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
[4800]REQ: Package = HTML::Embperl::DOC::_6
[4800]Reading /wwww/htdocs/head.epl as input using PerlIO ...
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Parse Start Time: 10 ms 
[4800]PERF: Parse End Time: 10 ms 
[4800]PERF: Parse Time: 0 ms 
[4800]PERF: DOMSTAT: MemUsage = 84264 Bytes numNodes = 48 numStr = 98 numReplace = 5 
[4800]CACHE: SvTYPE (*ppSV) = 0
[4800]PERF: Compile Start Time: 10 ms 
[4800]PERF: Compile End Time: 10 ms 
[4800]PERF: After Compile Exec End Time: 10 ms 
[4800]PERF: Perl Compile End Time: 20 ms 
[4800]PERF: Compile Time: 10 ms 
[4800]PERF: DOMSTAT: MemUsage = 84264 Bytes numNodes = 48 numStr = 98 numReplace = 5 
[4800]CACHE: SvTYPE (*ppSV) = 7
[4800]CACHE: SvTYPE (*ppSV) = 12
[4800]EVAL< <unknown>
[4800]EVAL> <undefined>
[4800]PERF: Run Start Time: 20 ms 
[4800]PERF: Run End Time: 20 ms 
[4800]PERF: Run Time: 0 ms 
[4800]PERF: DOMSTAT: MemUsage = 86376 Bytes numNodes = 49 numStr = 98 numReplace = 5 
[4800]PERF: input = /wwww/htdocs/head.epl
[4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
[4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
. Entry-SVs: 29074 -OBJs: 35 Exit-SVs: 29246 -OBJs: 36
[4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
[4800]CACHE: Found File for '/wwww/htdocs/new_review.epl' (818c780) in 'HTML::Embperl::DOC::_2' hash cache-key '/wwww/htdocs/new_review.epl'
[4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
[4800]REQ: Package = HTML::Embperl::DOC::_2
[4800]CACHE: SvTYPE (*ppSV) = 7
[4800]CACHE: SvTYPE (*ppSV) = 12
[4800]CACHE: SvTYPE (*ppSV) = 7
[4800]CACHE: SvTYPE (*ppSV) = 12
[4800]EVAL< <unknown>
[4800]EVAL> <undefined>
[4800]ERR: 24: Line 1: Error in Perl code: Undefined subroutine &HTML::Embperl::DOC::_2::log_event called at /wwww/htdocs/new_review.epl line 29.
[4800]PERF: Run Start Time: 0 ms 
[4800]PERF: Run End Time: 20 ms 
[4800]PERF: Run Time: 20 ms 
[4800]PERF: DOMSTAT: MemUsage = 87472 Bytes numNodes = 51 numStr = 98 numReplace = 5 
[4800]PERF: input = /wwww/htdocs/new_review.epl
[4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
[4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
. Entry-SVs: 29252 -OBJs: 37 Exit-SVs: 29444 -OBJs: 37
[4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
[4800]MEM: Load /wwww/htdocs/cleanup.epl in HTML::Embperl::DOC::_7
[4800]CACHE: New File for '/wwww/htdocs/cleanup.epl' (85641e8) in 'HTML::Embperl::DOC::_7' hash cache-key '/wwww/htdocs/cleanup.epl'
[4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
[4800]REQ: Package = HTML::Embperl::DOC::_7
[4800]Reading /wwww/htdocs/cleanup.epl as input using PerlIO ...
[4800]PERF: input = /wwww/htdocs/cleanup.epl
[4800]PERF: Time: 10 ms Evals: 0 No Evals to cache
[4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
. Entry-SVs: 29439 -OBJs: 38 Exit-SVs: 29544 -OBJs: 39
[4800]EVAL> 0
[4800]PERF: Run Start Time: 0 ms 
[4800]PERF: Run End Time: 1030 ms 
[4800]PERF: Run Time: 1030 ms 
[4800]PERF: DOMSTAT: MemUsage = 87472 Bytes numNodes = 51 numStr = 98 numReplace = 5 
[4800]PERF: input = /wwww/htdocs/base.epl
[4800]PERF: Time: 1040 ms Evals: 0 No Evals to cache
[4800]Request finished. Wed Nov 7 17:56:18 2001

============

Thanks for your help!  I'm enjoying this but it's quite a pain getting 
things to be happy sometimes!  I've read Neil's tutorial and the docs 
plenty of times and something is not "jelling" yet. I'm new to Perl and 
object oriented programming in general but I'm determined to make 
this work.  I wish there was a Embperl mentor here in Oregon that 
could work with me on this!  Thank God for the Internet!

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Still having problems with visibility of subroutine - long.

Posted by Andrew O'Brien <an...@switchonline.com.au>.
On Thu, Nov 08, 2001 at 07:22:15AM -0800, Scott Chapman wrote:
> Andrew,
> Thanks for all your help!

No worries. I've sent this to the list just in case someone else finds
the information useful.

> Can I tie the subroutines into the $req object hash so that they are  
> imported into places that $req is imported and perhaps not have to 
> call them using the $req->sub_name syntax or does $req only 
> work with variables?  In that case can I a pointer to the subroutine 
> in the $req hash?  

You can either do something with the EMBPERL_OBJECT_HANDLER_CLASS as I
mentioned before or you can put subroutines in $req. Either way you
will have to call the subroutine like $req->subname ... if you want to
call subroutines directly then put them in a module and have

[! use MyModule; !]

at the top of every file. Try not to think of the whole embperl
Execution path as being one big perl program - in a lot of ways, each
Execute is its own seperate "program" so you have to import subroutines
every time.

Some examples (I'm procrastinating on my own project, can't you tell?
:)

---------------- Using a module: ----------------

The file /path/to/MyModule.pm:

package MyModule; # give it a name
use strict;
use otherstuffyoumightneed;

use vars qw ($VERSION);
$VERSION = 0.01;

sub log_stuff {
  my ($self, $arg1, $arg2) = @_;
  ...
}

A standard blah.epl:

[! use MyModule; !]

[- log_stuff("Hello", "world"); -]


-------------- Using $req: -------------------

base.epl is the same

constants.epl:

[- $req = shift;
 $req->{somename} = 'somevalue';
 ...
 $req->{logstuff} = sub {
   my ($self, $arg1, $arg2) = @_; 
   ... 
 }
-]

Usage in a file.epl:

[- $req = shift;
  $req->{logstuff}("Hello", "world");
-]

------------ Using EMBPERL_OBJECT_HANDLER_CLASS -----------

In your httpd.conf:

# somewhere before you "use" EmbperlObject
# This assumes that this module can be found when Embperl starts up
PerlSetEnv EMBPERL_OBJECT_HANDLER_CLASS MyProject::MyReq
...

The file /path/to/MyProject/MyReq.pm:

package MyProject/MyReq;

use HTML::Embperl;
BEGIN {
  if (exists $ENV{MOD_PERL}) { use Apache; } # if you need this anywhere
};

use strict;
use vars qw($VERSION @ISA $escmode %fdat *OUT *LOG);

@ISA = qw(HTML::Embperl::Req);
BEGIN {
  ($VERSION) = '$Revision: 1.2 $' =~ /Revision: ([\d.]+)/; #'emacs;
};

# for convenience  
*escmode = \$HTML::Embperl::escmode;
*fdat = \%HTML::Embperl::fdat;
tie *OUT, 'HTML::Embperl::Out';
tie *LOG, 'HTML::Embperl::Log';

sub logstuff {
  my $self = shift;
  ...
}

Usage in a file.epl:

[- $req = shift;
  $req->logstuff("Hello", "world");
-]

---------------------------------------------------------------

> This object-oriented stuff is still rather of a black box to me.  I've 
> got Manning's Perl books as well as O'Reilly's but time to read 
> them is scarce in the middle of this project.

Good luck with it all ...

-- 
 Andrew O'Brien                                                               
 Product Engineer                        email: andrewo@switchonline.com.au.
 Switch Online Group Pty Limited         phone: +61 2 9299 1133             
 ABN 89 092 286 327                      fax: +61 2 9299 1134             

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Still having problems with visibility of subroutine - long.

Posted by Scott Chapman <sc...@mischko.com>.
Andrew,
Thanks for all your help!

Can I tie the subroutines into the $req object hash so that they are  
imported into places that $req is imported and perhaps not have to 
call them using the $req->sub_name syntax or does $req only 
work with variables?  In that case can I a pointer to the subroutine 
in the $req hash?  

This object-oriented stuff is still rather of a black box to me.  I've 
got Manning's Perl books as well as O'Reilly's but time to read 
them is scarce in the middle of this project.

Cordially,
Scott

On 8 Nov 2001, at 14:34, Andrew O'Brien wrote:

> On Wed, Nov 07, 2001 at 06:01:39PM -0800, Scott Chapman wrote:
> > I'm sorry to bother the list again but I'm missing something here.  I 
> > tried Andrew's suggestion and got it working some of the time and 
> > not some of the time (as if the caching of perl pseudo code was 
> > causing it to not reflect my changes).  I stopped apache and 
> > restarted it (assuming that will clear all caching) and here's what I'm 
> > getting consistently now:
> 
> James,
> 
>   The import only works for the current execute - it is not inherited
>   by subsequent sub-execute's. ie. base.epl knows about log_event but
>   this is not passed into the namespace of the Execute('*').
> 
>   Just about the only things you can assume that is constant to all
>   Execute'd code are things like $req, %fdat %udat etc - ie the
>   Embperl globals. That is why (I'm assuming) constants.epl shoves
>   info into the $req object hash.
> 
>   There are two different approaches you can use if you want common
>   subroutines. One is to have your own class that overrides that
>   which provides the $req object. Look at the
>   EMBPERL_OBJECT_HANDLER_CLASS directive.
> 
>   The other is to use the "object" option to Execute instead of the
>   import. If you change the line in base.epl to:
> 
>   $lib = Execute({object => 'subs.epl'});
> 
>   Then you now have something that can be treated as a normal perl
>   object with all subs.epl's routines.
> 
>   Change the "Execute ('*')" to "Execute('*', $lib)", add a line
>   like "$lib = $param[0];" to the top of new_review.epl and change all
>   instances of log_event to $lib->log_event and you're set.
> 
>   Yeah sure, there is a small hassle of needing to have every file
>   get $lib from $param[0] (and remembering to pass it in in the first
>   place) but you can override functions in $lib just like other
>   Embperl::Object inheritance by taking advantage of the "isa" option
>   in subsequent sub.epl incarnations further out the execution tree.
> 
> Andrew
> 
> > Here's what I'm getting on the web page,followed by new_review.epl (the page called when this happened), base.epl, subs.epl, and the logfile entries.
> > 
> > Internal Server Error
> > The server encountered an internal error or misconfiguration and was unable to complete your request.
> > Please contact the server administrator, root@laptop.mischko.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
> > 
> > [4800]ERR: 24: Line 1: Error in Perl code: Undefined subroutine &HTML::Embperl::DOC::_2::log_ev
ent called at /wwww/htdocs/new_review.epl line 29.
> > 
> > Apache/1.3.20 (Unix) mod_perl/1.26 HTML::Embperl 2.0b3 [Wed Nov 7 17:56:18 2001]
> > 
> > ================ new_review.epl:
> > 
> > <HTML>
> > <HEAD>
> > <TITLE>Process Annual Review request</TITLE>
> > </HEAD>
> > <BODY>
> > 
> > [-
> >     
> >   # Get data that EmbperlObject makes available to all web pages 
> > 
> >     $req = shift;
> > 
> >   # EmbperlObject has us already connected to the database.
> >   # Get new Annual Review number from database.
> > 
> >     my ($sth) = $req->{dbh}->prepare ("select ar_num.NEXTVAL from DUAL");
> >     $sth->execute();
> >     $review_num = $sth->fetchrow_array;
> > 
> >   # Generate random directory name to hold this new review.
> >   # Make sure it doesn't already exist and make the new directory.
> > 
> >     @chars = ( "a" .. "z" );
> >     $dir_name='';
> >     do {
> >         $dir_name = join("", @chars[ map { rand @chars } ( 1 .. 8 ) ]);
> >     } until (! -e "/wwww/htdocs/$dir_name");
> >     mkdir("/wwww/htdocs/$dir_name", 0700) || die "Cannot mkdir newdir: $!";
> >     
> >     log_event ($review_num,'ReviewDirectory',$dir_name);
> > 
> >   # Store the Annual Review number in "reviewnum.dat" file in the new directory
> > 
> >     open(REVNUM_FILE, "> $dir_name/reviewnum.dat")
> >         or die "Couldn't open $dir_name/reviewnum.dat for writing: $!\n";
> >     print (REVNUM_FILE $review_num);
> >     close (REVNUM_FILE);
> >   
> >   # Make symlinks to all the processing files in the directory above the new directory.
> >   # This way the files will be accessed as if they were in the new directory and .htaccess
> >   # restrictions will apply.
> >   
> >   # Determine the type of review from data submitted in the previous form and symlink the quest
.epl 
> >   # file in the new directory to the appropriate questionairre file in the directory above.
> >   
> >     if ("$fdat{review_type}" eq "MPE") 
> >         {symlink("/wwww/htdocs/mpe_quest.epl","$dir_name/quest.epl") || die "cannot symlink que
stionairre file.";} 
> >     elsif ("$fdat{review_type}" eq "HPUX") 
> >         {symlink("/wwww/htdocs/hpux_quest.epl","$dir_name/quest.epl") || die "cannot symlink qu
estionairre file.";} 
> >     elsif ("$fdat{review_type}" eq "SOLARIS") 
> >         {symlink("/wwww/htdocs/solaris_quest.epl","$dir_name/quest.epl") || die "cannot symlink
 questionairre file.";} 
> >     elsif ("$fdat{review_type}" eq "LINUX") 
> >         {symlink("/wwww/htdocs/linux_quest.epl","$dir_name/quest.epl") || die "cannot symlink q
uestionairre file.";}
> > 
> >   # symlink the upload form
> >   
> >   # symlink the final page
> >   
> >   # create username and password
> >   
> >   # add user to password file
> >   
> >   # create .htaccess file
> >   
> >     log_event ($review_num,'CreateReview',$fdat{review_type});
> >     
> >   # direct the user to the questionairre
> >   
> > 
> > -]
> > 
> > </BODY>
> > </HTML>
> > 
> > ================ base.epl:
> > 
> > <HTML>
> > 	[- Execute ('constants.epl') -]
> > 	[- Execute ('init.epl') -]
> >         [- Execute ({ inputfile => 'subs.epl', import => 1}) -]
> > <HEAD>
> > 	[- Execute ('head.epl') -]
> > </HEAD>
> > <BODY>
> > 	[- Execute ('*') -]
> > </BODY>
> > 	[- Execute ('cleanup.epl') -]
> > </HTML>
> > ================ subs.epl:
> > 
> > [-
> >   # logs events to the database.
> >   sub log_event
> >   {
> >       $review_num = shift;
> >       $event = shift;
> >       $info = shift;
> >       if (!defined $req_rec -> connection -> user) {
> >           $user="nobody";
> >       } else {
> >           $user=$req_rec -> connection -> user;
> >       }
> >       $req->{dbh}->do("INSERT INTO ar_events VALUES ($review_num,time(),'$event','$user','$info
')");
> >   }
> > 
> > -]
> > 
> > ================ Logfile:
> > 
> > Logfile = /tmp/embperl.log, Position = 1808543, Pid = 4800
> > [4800]REQ: Embperl 2.0b3 starting... Wed Nov 7 17:56:17 2001
> > 
> > [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> > [4800]REQ: Package = HTML::Embperl::DOC::_1
> > [4800]Formdata... length = 15
> > [4800]FORM: review_type=MPE
> > [4800]Using APACHE for output...
> > [4800]CACHE: SvTYPE (*ppSV) = 7
> > [4800]CACHE: SvTYPE (*ppSV) = 12
> > [4800]CACHE: SvTYPE (*ppSV) = 7
> > [4800]CACHE: SvTYPE (*ppSV) = 12
> > [4800]EVAL< <unknown>
> > [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> > [4800]MEM: Load /wwww/htdocs/constants.epl in HTML::Embperl::DOC::_3
> > [4800]CACHE: New File for '/wwww/htdocs/constants.epl' (83b6e90) in 'HTML::Embperl::DOC::_3' ha
sh cache-key '/wwww/htdocs/constants.epl'
> > [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> > [4800]REQ: Package = HTML::Embperl::DOC::_3
> > [4800]Reading /wwww/htdocs/constants.epl as input using PerlIO ...
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Parse Start Time: 10 ms 
> > [4800]PERF: Parse End Time: 10 ms 
> > [4800]PERF: Parse Time: 0 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 69684 Bytes numNodes = 29 numStr = 92 numReplace = 5 
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Compile Start Time: 10 ms 
> > [4800]PERF: Compile End Time: 20 ms 
> > [4800]PERF: After Compile Exec End Time: 20 ms 
> > [4800]PERF: Perl Compile End Time: 20 ms 
> > [4800]PERF: Compile Time: 10 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 69684 Bytes numNodes = 27 numStr = 92 numReplace = 5 
> > [4800]CACHE: SvTYPE (*ppSV) = 7
> > [4800]CACHE: SvTYPE (*ppSV) = 12
> > [4800]EVAL< <unknown>
> > [4800]EVAL> <undefined>
> > [4800]PERF: Run Start Time: 20 ms 
> > [4800]PERF: Run End Time: 20 ms 
> > [4800]PERF: Run Time: 0 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 71804 Bytes numNodes = 28 numStr = 92 numReplace = 5 
> > [4800]PERF: input = /wwww/htdocs/constants.epl
> > [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> > [4800]Sub-Request finished. Wed Nov 7 17:56:17 2001
> > . Entry-SVs: 17110 -OBJs: 16 Exit-SVs: 17317 -OBJs: 18
> > [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> > [4800]MEM: Load /wwww/htdocs/init.epl in HTML::Embperl::DOC::_4
> > [4800]CACHE: New File for '/wwww/htdocs/init.epl' (83b6988) in 'HTML::Embperl::DOC::_4' hash ca
che-key '/wwww/htdocs/init.epl'
> > [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> > [4800]REQ: Package = HTML::Embperl::DOC::_4
> > [4800]Reading /wwww/htdocs/init.epl as input using PerlIO ...
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Parse Start Time: 10 ms 
> > [4800]PERF: Parse End Time: 10 ms 
> > [4800]PERF: Parse Time: 0 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 75936 Bytes numNodes = 38 numStr = 94 numReplace = 5 
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Compile Start Time: 10 ms 
> > [4800]PERF: Compile End Time: 20 ms 
> > [4800]PERF: After Compile Exec End Time: 20 ms 
> > [4800]PERF: Perl Compile End Time: 240 ms 
> > [4800]PERF: Compile Time: 230 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 75936 Bytes numNodes = 36 numStr = 94 numReplace = 5 
> > [4800]CACHE: SvTYPE (*ppSV) = 7
> > [4800]CACHE: SvTYPE (*ppSV) = 12
> > [4800]EVAL< <unknown>
> > [4800]EVAL> <undefined>
> > [4800]PERF: Run Start Time: 240 ms 
> > [4800]PERF: Run End Time: 940 ms 
> > [4800]PERF: Run Time: 700 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 78056 Bytes numNodes = 37 numStr = 94 numReplace = 5 
> > [4800]PERF: input = /wwww/htdocs/init.epl
> > [4800]PERF: Time: 940 ms Evals: 0 No Evals to cache
> > [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> > . Entry-SVs: 17332 -OBJs: 19 Exit-SVs: 28842 -OBJs: 32
> > [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> > [4800]MEM: Load /wwww/htdocs/subs.epl in HTML::Embperl::DOC::_5
> > [4800]CACHE: New File for '/wwww/htdocs/subs.epl' (83bd8d0) in 'HTML::Embperl::DOC::_5' hash ca
che-key '/wwww/htdocs/subs.epl'
> > [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> > [4800]REQ: Package = HTML::Embperl::DOC::_5
> > [4800]Reading /wwww/htdocs/subs.epl as input using PerlIO ...
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Parse Start Time: 10 ms 
> > [4800]PERF: Parse End Time: 10 ms 
> > [4800]PERF: Parse Time: 0 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 81160 Bytes numNodes = 44 numStr = 96 numReplace = 5 
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Compile Start Time: 10 ms 
> > [4800]PERF: Compile End Time: 10 ms 
> > [4800]PERF: After Compile Exec End Time: 10 ms 
> > [4800]PERF: Perl Compile End Time: 20 ms 
> > [4800]PERF: Compile Time: 10 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 81160 Bytes numNodes = 43 numStr = 96 numReplace = 5 
> > [4800]PERF: input = /wwww/htdocs/subs.epl
> > [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> > [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> > . Entry-SVs: 28843 -OBJs: 33 Exit-SVs: 29070 -OBJs: 34
> > [4800]IMP: Create Imports for HTML::Embperl::DOC::_1 from HTML::Embperl::DOC::_5 (HASH(0x85595f
4))
> > [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> > [4800]MEM: Load /wwww/htdocs/head.epl in HTML::Embperl::DOC::_6
> > [4800]CACHE: New File for '/wwww/htdocs/head.epl' (83ce8b8) in 'HTML::Embperl::DOC::_6' hash ca
che-key '/wwww/htdocs/head.epl'
> > [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> > [4800]REQ: Package = HTML::Embperl::DOC::_6
> > [4800]Reading /wwww/htdocs/head.epl as input using PerlIO ...
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Parse Start Time: 10 ms 
> > [4800]PERF: Parse End Time: 10 ms 
> > [4800]PERF: Parse Time: 0 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 84264 Bytes numNodes = 48 numStr = 98 numReplace = 5 
> > [4800]CACHE: SvTYPE (*ppSV) = 0
> > [4800]PERF: Compile Start Time: 10 ms 
> > [4800]PERF: Compile End Time: 10 ms 
> > [4800]PERF: After Compile Exec End Time: 10 ms 
> > [4800]PERF: Perl Compile End Time: 20 ms 
> > [4800]PERF: Compile Time: 10 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 84264 Bytes numNodes = 48 numStr = 98 numReplace = 5 
> > [4800]CACHE: SvTYPE (*ppSV) = 7
> > [4800]CACHE: SvTYPE (*ppSV) = 12
> > [4800]EVAL< <unknown>
> > [4800]EVAL> <undefined>
> > [4800]PERF: Run Start Time: 20 ms 
> > [4800]PERF: Run End Time: 20 ms 
> > [4800]PERF: Run Time: 0 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 86376 Bytes numNodes = 49 numStr = 98 numReplace = 5 
> > [4800]PERF: input = /wwww/htdocs/head.epl
> > [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> > [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> > . Entry-SVs: 29074 -OBJs: 35 Exit-SVs: 29246 -OBJs: 36
> > [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> > [4800]CACHE: Found File for '/wwww/htdocs/new_review.epl' (818c780) in 'HTML::Embperl::DOC::_2'
 hash cache-key '/wwww/htdocs/new_review.epl'
> > [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> > [4800]REQ: Package = HTML::Embperl::DOC::_2
> > [4800]CACHE: SvTYPE (*ppSV) = 7
> > [4800]CACHE: SvTYPE (*ppSV) = 12
> > [4800]CACHE: SvTYPE (*ppSV) = 7
> > [4800]CACHE: SvTYPE (*ppSV) = 12
> > [4800]EVAL< <unknown>
> > [4800]EVAL> <undefined>
> > [4800]ERR: 24: Line 1: Error in Perl code: Undefined subroutine &HTML::Embperl::DOC::_2::log_ev
ent called at /wwww/htdocs/new_review.epl line 29.
> > [4800]PERF: Run Start Time: 0 ms 
> > [4800]PERF: Run End Time: 20 ms 
> > [4800]PERF: Run Time: 20 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 87472 Bytes numNodes = 51 numStr = 98 numReplace = 5 
> > [4800]PERF: input = /wwww/htdocs/new_review.epl
> > [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> > [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> > . Entry-SVs: 29252 -OBJs: 37 Exit-SVs: 29444 -OBJs: 37
> > [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> > [4800]MEM: Load /wwww/htdocs/cleanup.epl in HTML::Embperl::DOC::_7
> > [4800]CACHE: New File for '/wwww/htdocs/cleanup.epl' (85641e8) in 'HTML::Embperl::DOC::_7' hash
 cache-key '/wwww/htdocs/cleanup.epl'
> > [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> > [4800]REQ: Package = HTML::Embperl::DOC::_7
> > [4800]Reading /wwww/htdocs/cleanup.epl as input using PerlIO ...
> > [4800]PERF: input = /wwww/htdocs/cleanup.epl
> > [4800]PERF: Time: 10 ms Evals: 0 No Evals to cache
> > [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> > . Entry-SVs: 29439 -OBJs: 38 Exit-SVs: 29544 -OBJs: 39
> > [4800]EVAL> 0
> > [4800]PERF: Run Start Time: 0 ms 
> > [4800]PERF: Run End Time: 1030 ms 
> > [4800]PERF: Run Time: 1030 ms 
> > [4800]PERF: DOMSTAT: MemUsage = 87472 Bytes numNodes = 51 numStr = 98 numReplace = 5 
> > [4800]PERF: input = /wwww/htdocs/base.epl
> > [4800]PERF: Time: 1040 ms Evals: 0 No Evals to cache
> > [4800]Request finished. Wed Nov 7 17:56:18 2001
> > 
> > ============
> > 
> > Thanks for your help!  I'm enjoying this but it's quite a pain getting 
> > things to be happy sometimes!  I've read Neil's tutorial and the docs 
> > plenty of times and something is not "jelling" yet. I'm new to Perl and 
> > object oriented programming in general but I'm determined to make 
> > this work.  I wish there was a Embperl mentor here in Oregon that 
> > could work with me on this!  Thank God for the Internet!
> > 
> > Scott
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> > 
> 
> -- 
>  Andrew O'Brien                                                               
>  Product Engineer                        email: andrewo@switchonline.com.au.
>  Switch Online Group Pty Limited         phone: +61 2 9299 1133             
>  ABN 89 092 286 327                      fax: +61 2 9299 1134             
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Still having problems with visibility of subroutine - long.

Posted by Andrew O'Brien <an...@switchonline.com.au>.
On Wed, Nov 07, 2001 at 06:01:39PM -0800, Scott Chapman wrote:
> I'm sorry to bother the list again but I'm missing something here.  I 
> tried Andrew's suggestion and got it working some of the time and 
> not some of the time (as if the caching of perl pseudo code was 
> causing it to not reflect my changes).  I stopped apache and 
> restarted it (assuming that will clear all caching) and here's what I'm 
> getting consistently now:

James,

  The import only works for the current execute - it is not inherited
  by subsequent sub-execute's. ie. base.epl knows about log_event but
  this is not passed into the namespace of the Execute('*').

  Just about the only things you can assume that is constant to all
  Execute'd code are things like $req, %fdat %udat etc - ie the
  Embperl globals. That is why (I'm assuming) constants.epl shoves
  info into the $req object hash.

  There are two different approaches you can use if you want common
  subroutines. One is to have your own class that overrides that
  which provides the $req object. Look at the
  EMBPERL_OBJECT_HANDLER_CLASS directive.

  The other is to use the "object" option to Execute instead of the
  import. If you change the line in base.epl to:

  $lib = Execute({object => 'subs.epl'});

  Then you now have something that can be treated as a normal perl
  object with all subs.epl's routines.

  Change the "Execute ('*')" to "Execute('*', $lib)", add a line
  like "$lib = $param[0];" to the top of new_review.epl and change all
  instances of log_event to $lib->log_event and you're set.

  Yeah sure, there is a small hassle of needing to have every file
  get $lib from $param[0] (and remembering to pass it in in the first
  place) but you can override functions in $lib just like other
  Embperl::Object inheritance by taking advantage of the "isa" option
  in subsequent sub.epl incarnations further out the execution tree.

Andrew

> Here's what I'm getting on the web page,followed by new_review.epl (the page called when this happened), base.epl, subs.epl, and the logfile entries.
> 
> Internal Server Error
> The server encountered an internal error or misconfiguration and was unable to complete your request.
> Please contact the server administrator, root@laptop.mischko.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
> 
> [4800]ERR: 24: Line 1: Error in Perl code: Undefined subroutine &HTML::Embperl::DOC::_2::log_event called at /wwww/htdocs/new_review.epl line 29.
> 
> Apache/1.3.20 (Unix) mod_perl/1.26 HTML::Embperl 2.0b3 [Wed Nov 7 17:56:18 2001]
> 
> ================ new_review.epl:
> 
> <HTML>
> <HEAD>
> <TITLE>Process Annual Review request</TITLE>
> </HEAD>
> <BODY>
> 
> [-
>     
>   # Get data that EmbperlObject makes available to all web pages 
> 
>     $req = shift;
> 
>   # EmbperlObject has us already connected to the database.
>   # Get new Annual Review number from database.
> 
>     my ($sth) = $req->{dbh}->prepare ("select ar_num.NEXTVAL from DUAL");
>     $sth->execute();
>     $review_num = $sth->fetchrow_array;
> 
>   # Generate random directory name to hold this new review.
>   # Make sure it doesn't already exist and make the new directory.
> 
>     @chars = ( "a" .. "z" );
>     $dir_name='';
>     do {
>         $dir_name = join("", @chars[ map { rand @chars } ( 1 .. 8 ) ]);
>     } until (! -e "/wwww/htdocs/$dir_name");
>     mkdir("/wwww/htdocs/$dir_name", 0700) || die "Cannot mkdir newdir: $!";
>     
>     log_event ($review_num,'ReviewDirectory',$dir_name);
> 
>   # Store the Annual Review number in "reviewnum.dat" file in the new directory
> 
>     open(REVNUM_FILE, "> $dir_name/reviewnum.dat")
>         or die "Couldn't open $dir_name/reviewnum.dat for writing: $!\n";
>     print (REVNUM_FILE $review_num);
>     close (REVNUM_FILE);
>   
>   # Make symlinks to all the processing files in the directory above the new directory.
>   # This way the files will be accessed as if they were in the new directory and .htaccess
>   # restrictions will apply.
>   
>   # Determine the type of review from data submitted in the previous form and symlink the quest.epl 
>   # file in the new directory to the appropriate questionairre file in the directory above.
>   
>     if ("$fdat{review_type}" eq "MPE") 
>         {symlink("/wwww/htdocs/mpe_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";} 
>     elsif ("$fdat{review_type}" eq "HPUX") 
>         {symlink("/wwww/htdocs/hpux_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";} 
>     elsif ("$fdat{review_type}" eq "SOLARIS") 
>         {symlink("/wwww/htdocs/solaris_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";} 
>     elsif ("$fdat{review_type}" eq "LINUX") 
>         {symlink("/wwww/htdocs/linux_quest.epl","$dir_name/quest.epl") || die "cannot symlink questionairre file.";}
> 
>   # symlink the upload form
>   
>   # symlink the final page
>   
>   # create username and password
>   
>   # add user to password file
>   
>   # create .htaccess file
>   
>     log_event ($review_num,'CreateReview',$fdat{review_type});
>     
>   # direct the user to the questionairre
>   
> 
> -]
> 
> </BODY>
> </HTML>
> 
> ================ base.epl:
> 
> <HTML>
> 	[- Execute ('constants.epl') -]
> 	[- Execute ('init.epl') -]
>         [- Execute ({ inputfile => 'subs.epl', import => 1}) -]
> <HEAD>
> 	[- Execute ('head.epl') -]
> </HEAD>
> <BODY>
> 	[- Execute ('*') -]
> </BODY>
> 	[- Execute ('cleanup.epl') -]
> </HTML>
> ================ subs.epl:
> 
> [-
>   # logs events to the database.
>   sub log_event
>   {
>       $review_num = shift;
>       $event = shift;
>       $info = shift;
>       if (!defined $req_rec -> connection -> user) {
>           $user="nobody";
>       } else {
>           $user=$req_rec -> connection -> user;
>       }
>       $req->{dbh}->do("INSERT INTO ar_events VALUES ($review_num,time(),'$event','$user','$info')");
>   }
> 
> -]
> 
> ================ Logfile:
> 
> Logfile = /tmp/embperl.log, Position = 1808543, Pid = 4800
> [4800]REQ: Embperl 2.0b3 starting... Wed Nov 7 17:56:17 2001
> 
> [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> [4800]REQ: Package = HTML::Embperl::DOC::_1
> [4800]Formdata... length = 15
> [4800]FORM: review_type=MPE
> [4800]Using APACHE for output...
> [4800]CACHE: SvTYPE (*ppSV) = 7
> [4800]CACHE: SvTYPE (*ppSV) = 12
> [4800]CACHE: SvTYPE (*ppSV) = 7
> [4800]CACHE: SvTYPE (*ppSV) = 12
> [4800]EVAL< <unknown>
> [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> [4800]MEM: Load /wwww/htdocs/constants.epl in HTML::Embperl::DOC::_3
> [4800]CACHE: New File for '/wwww/htdocs/constants.epl' (83b6e90) in 'HTML::Embperl::DOC::_3' hash cache-key '/wwww/htdocs/constants.epl'
> [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> [4800]REQ: Package = HTML::Embperl::DOC::_3
> [4800]Reading /wwww/htdocs/constants.epl as input using PerlIO ...
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Parse Start Time: 10 ms 
> [4800]PERF: Parse End Time: 10 ms 
> [4800]PERF: Parse Time: 0 ms 
> [4800]PERF: DOMSTAT: MemUsage = 69684 Bytes numNodes = 29 numStr = 92 numReplace = 5 
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Compile Start Time: 10 ms 
> [4800]PERF: Compile End Time: 20 ms 
> [4800]PERF: After Compile Exec End Time: 20 ms 
> [4800]PERF: Perl Compile End Time: 20 ms 
> [4800]PERF: Compile Time: 10 ms 
> [4800]PERF: DOMSTAT: MemUsage = 69684 Bytes numNodes = 27 numStr = 92 numReplace = 5 
> [4800]CACHE: SvTYPE (*ppSV) = 7
> [4800]CACHE: SvTYPE (*ppSV) = 12
> [4800]EVAL< <unknown>
> [4800]EVAL> <undefined>
> [4800]PERF: Run Start Time: 20 ms 
> [4800]PERF: Run End Time: 20 ms 
> [4800]PERF: Run Time: 0 ms 
> [4800]PERF: DOMSTAT: MemUsage = 71804 Bytes numNodes = 28 numStr = 92 numReplace = 5 
> [4800]PERF: input = /wwww/htdocs/constants.epl
> [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> [4800]Sub-Request finished. Wed Nov 7 17:56:17 2001
> . Entry-SVs: 17110 -OBJs: 16 Exit-SVs: 17317 -OBJs: 18
> [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> [4800]MEM: Load /wwww/htdocs/init.epl in HTML::Embperl::DOC::_4
> [4800]CACHE: New File for '/wwww/htdocs/init.epl' (83b6988) in 'HTML::Embperl::DOC::_4' hash cache-key '/wwww/htdocs/init.epl'
> [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> [4800]REQ: Package = HTML::Embperl::DOC::_4
> [4800]Reading /wwww/htdocs/init.epl as input using PerlIO ...
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Parse Start Time: 10 ms 
> [4800]PERF: Parse End Time: 10 ms 
> [4800]PERF: Parse Time: 0 ms 
> [4800]PERF: DOMSTAT: MemUsage = 75936 Bytes numNodes = 38 numStr = 94 numReplace = 5 
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Compile Start Time: 10 ms 
> [4800]PERF: Compile End Time: 20 ms 
> [4800]PERF: After Compile Exec End Time: 20 ms 
> [4800]PERF: Perl Compile End Time: 240 ms 
> [4800]PERF: Compile Time: 230 ms 
> [4800]PERF: DOMSTAT: MemUsage = 75936 Bytes numNodes = 36 numStr = 94 numReplace = 5 
> [4800]CACHE: SvTYPE (*ppSV) = 7
> [4800]CACHE: SvTYPE (*ppSV) = 12
> [4800]EVAL< <unknown>
> [4800]EVAL> <undefined>
> [4800]PERF: Run Start Time: 240 ms 
> [4800]PERF: Run End Time: 940 ms 
> [4800]PERF: Run Time: 700 ms 
> [4800]PERF: DOMSTAT: MemUsage = 78056 Bytes numNodes = 37 numStr = 94 numReplace = 5 
> [4800]PERF: input = /wwww/htdocs/init.epl
> [4800]PERF: Time: 940 ms Evals: 0 No Evals to cache
> [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> . Entry-SVs: 17332 -OBJs: 19 Exit-SVs: 28842 -OBJs: 32
> [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> [4800]MEM: Load /wwww/htdocs/subs.epl in HTML::Embperl::DOC::_5
> [4800]CACHE: New File for '/wwww/htdocs/subs.epl' (83bd8d0) in 'HTML::Embperl::DOC::_5' hash cache-key '/wwww/htdocs/subs.epl'
> [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> [4800]REQ: Package = HTML::Embperl::DOC::_5
> [4800]Reading /wwww/htdocs/subs.epl as input using PerlIO ...
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Parse Start Time: 10 ms 
> [4800]PERF: Parse End Time: 10 ms 
> [4800]PERF: Parse Time: 0 ms 
> [4800]PERF: DOMSTAT: MemUsage = 81160 Bytes numNodes = 44 numStr = 96 numReplace = 5 
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Compile Start Time: 10 ms 
> [4800]PERF: Compile End Time: 10 ms 
> [4800]PERF: After Compile Exec End Time: 10 ms 
> [4800]PERF: Perl Compile End Time: 20 ms 
> [4800]PERF: Compile Time: 10 ms 
> [4800]PERF: DOMSTAT: MemUsage = 81160 Bytes numNodes = 43 numStr = 96 numReplace = 5 
> [4800]PERF: input = /wwww/htdocs/subs.epl
> [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> . Entry-SVs: 28843 -OBJs: 33 Exit-SVs: 29070 -OBJs: 34
> [4800]IMP: Create Imports for HTML::Embperl::DOC::_1 from HTML::Embperl::DOC::_5 (HASH(0x85595f4))
> [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> [4800]MEM: Load /wwww/htdocs/head.epl in HTML::Embperl::DOC::_6
> [4800]CACHE: New File for '/wwww/htdocs/head.epl' (83ce8b8) in 'HTML::Embperl::DOC::_6' hash cache-key '/wwww/htdocs/head.epl'
> [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> [4800]REQ: Package = HTML::Embperl::DOC::_6
> [4800]Reading /wwww/htdocs/head.epl as input using PerlIO ...
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Parse Start Time: 10 ms 
> [4800]PERF: Parse End Time: 10 ms 
> [4800]PERF: Parse Time: 0 ms 
> [4800]PERF: DOMSTAT: MemUsage = 84264 Bytes numNodes = 48 numStr = 98 numReplace = 5 
> [4800]CACHE: SvTYPE (*ppSV) = 0
> [4800]PERF: Compile Start Time: 10 ms 
> [4800]PERF: Compile End Time: 10 ms 
> [4800]PERF: After Compile Exec End Time: 10 ms 
> [4800]PERF: Perl Compile End Time: 20 ms 
> [4800]PERF: Compile Time: 10 ms 
> [4800]PERF: DOMSTAT: MemUsage = 84264 Bytes numNodes = 48 numStr = 98 numReplace = 5 
> [4800]CACHE: SvTYPE (*ppSV) = 7
> [4800]CACHE: SvTYPE (*ppSV) = 12
> [4800]EVAL< <unknown>
> [4800]EVAL> <undefined>
> [4800]PERF: Run Start Time: 20 ms 
> [4800]PERF: Run End Time: 20 ms 
> [4800]PERF: Run Time: 0 ms 
> [4800]PERF: DOMSTAT: MemUsage = 86376 Bytes numNodes = 49 numStr = 98 numReplace = 5 
> [4800]PERF: input = /wwww/htdocs/head.epl
> [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> . Entry-SVs: 29074 -OBJs: 35 Exit-SVs: 29246 -OBJs: 36
> [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> [4800]CACHE: Found File for '/wwww/htdocs/new_review.epl' (818c780) in 'HTML::Embperl::DOC::_2' hash cache-key '/wwww/htdocs/new_review.epl'
> [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> [4800]REQ: Package = HTML::Embperl::DOC::_2
> [4800]CACHE: SvTYPE (*ppSV) = 7
> [4800]CACHE: SvTYPE (*ppSV) = 12
> [4800]CACHE: SvTYPE (*ppSV) = 7
> [4800]CACHE: SvTYPE (*ppSV) = 12
> [4800]EVAL< <unknown>
> [4800]EVAL> <undefined>
> [4800]ERR: 24: Line 1: Error in Perl code: Undefined subroutine &HTML::Embperl::DOC::_2::log_event called at /wwww/htdocs/new_review.epl line 29.
> [4800]PERF: Run Start Time: 0 ms 
> [4800]PERF: Run End Time: 20 ms 
> [4800]PERF: Run Time: 20 ms 
> [4800]PERF: DOMSTAT: MemUsage = 87472 Bytes numNodes = 51 numStr = 98 numReplace = 5 
> [4800]PERF: input = /wwww/htdocs/new_review.epl
> [4800]PERF: Time: 20 ms Evals: 0 No Evals to cache
> [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> . Entry-SVs: 29252 -OBJs: 37 Exit-SVs: 29444 -OBJs: 37
> [4800]SYNTAX: switch to HTML::Embperl::Syntax::Embperl
> [4800]MEM: Load /wwww/htdocs/cleanup.epl in HTML::Embperl::DOC::_7
> [4800]CACHE: New File for '/wwww/htdocs/cleanup.epl' (85641e8) in 'HTML::Embperl::DOC::_7' hash cache-key '/wwww/htdocs/cleanup.epl'
> [4800]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3) EP 2.x
> [4800]REQ: Package = HTML::Embperl::DOC::_7
> [4800]Reading /wwww/htdocs/cleanup.epl as input using PerlIO ...
> [4800]PERF: input = /wwww/htdocs/cleanup.epl
> [4800]PERF: Time: 10 ms Evals: 0 No Evals to cache
> [4800]Sub-Request finished. Wed Nov 7 17:56:18 2001
> . Entry-SVs: 29439 -OBJs: 38 Exit-SVs: 29544 -OBJs: 39
> [4800]EVAL> 0
> [4800]PERF: Run Start Time: 0 ms 
> [4800]PERF: Run End Time: 1030 ms 
> [4800]PERF: Run Time: 1030 ms 
> [4800]PERF: DOMSTAT: MemUsage = 87472 Bytes numNodes = 51 numStr = 98 numReplace = 5 
> [4800]PERF: input = /wwww/htdocs/base.epl
> [4800]PERF: Time: 1040 ms Evals: 0 No Evals to cache
> [4800]Request finished. Wed Nov 7 17:56:18 2001
> 
> ============
> 
> Thanks for your help!  I'm enjoying this but it's quite a pain getting 
> things to be happy sometimes!  I've read Neil's tutorial and the docs 
> plenty of times and something is not "jelling" yet. I'm new to Perl and 
> object oriented programming in general but I'm determined to make 
> this work.  I wish there was a Embperl mentor here in Oregon that 
> could work with me on this!  Thank God for the Internet!
> 
> Scott
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 

-- 
 Andrew O'Brien                                                               
 Product Engineer                        email: andrewo@switchonline.com.au.
 Switch Online Group Pty Limited         phone: +61 2 9299 1133             
 ABN 89 092 286 327                      fax: +61 2 9299 1134             

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org