You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Praveen Ray <pr...@yahoo.com> on 2002/05/22 20:25:09 UTC

Parse::RecDescent under mod_perl

Hi
I Can't get this module to run under mod_perl. I have
installed this module on my machine and the script when
called from command line works fine. But When called from
within Apache from a mod_perl script, it fails to
instantiate Parse::RecDescent Module. I wrapped the
'Parse::RecDescent->new($grammar)' call in 'eval' and
printed out '$@' after in a file. Here is the error : 

Unknown starting rule (Parse::RecDescent::0::Replace)
called at EXPR_EVAL.pm line 20. 
Line 20 is :
$p=Parse::RecDescent->new($grammar)

It dies inside RecDescent.pm at the end of 'sub new':
$self->Replace(@_)

I can see the 'Replace' routine a few lines below. Why
can't
it find 'Replace' when it did find 'sub new' in the same
package and same file?

Again, the same module (EXPR-EVAL.pm) runs just fine when
called from a script on the command line! 
Any suggestions are welcome.



=====
  - Praveen  

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

Re: Parse::RecDescent under mod_perl

Posted by Steven Lembark <le...@wrkhors.com>.

-- Praveen Ray <pr...@yahoo.com>

> Hi
> I Can't get this module to run under mod_perl. I have
> installed this module on my machine and the script when
> called from command line works fine. But When called from
> within Apache from a mod_perl script, it fails to
> instantiate Parse::RecDescent Module. I wrapped the
> 'Parse::RecDescent->new($grammar)' call in 'eval' and
> printed out '$@' after in a file. Here is the error :
>
> Unknown starting rule (Parse::RecDescent::0::Replace)
> called at EXPR_EVAL.pm line 20.
> Line 20 is :
> $p=Parse::RecDescent->new($grammar)
>
> It dies inside RecDescent.pm at the end of 'sub new':
> $self->Replace(@_)

> I can see the 'Replace' routine a few lines below. Why
> can't
> it find 'Replace' when it did find 'sub new' in the same
> package and same file?
>
> Again, the same module (EXPR-EVAL.pm) runs just fine when
> called from a script on the command line!
> Any suggestions are welcome.

Parse::RecDescent::new is in the P::RD package; your
methods are in a package specific to the parser. What
package is Replace in?

Turn on tracing and see the output.


  $::RD_HINT         # if defined, also suggestion remedies
  $::RD_TRACE        # if defined, also trace parsers' behaviour
  $::RD_AUTOSTUB     # if defined, generates "stubs" for undefined rules

Start by setting the hint and trace to something and
see if the trace output tells you anything more
interesting. The hint might also be a good place to
check. If autostub fixes your problem it is likely
due to a typo in the naming somewhere.


--
Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 800 762 1582