in reply to Re^2: An error in using XS
in thread An error in using XS

Welcome to perlmonks ming_322. I hope you find the answers you are looking for here. Why not just write the parser in perl? Maybe using dispatch tables? Just a thought.

Thats a lot of code for us to wade through. Could you factor it into a smaller subset that exhibits the same error? It would seem that you wouldn't need all the parser code to reach the same error. You could stub that out.

I have to agree with chromatic your code attempting to call a subroutine "class". Probably a parameter passing error somewhere.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Replies are listed 'Best First'.
Re^4: An error in using XS
by ming_322 (Initiate) on Jul 12, 2006 at 02:15 UTC
    Hi starboin, thank you for your suggestion!
    I do dream of writing a parser myself one day, but, in fact I am just a beginner to perl.
    Besides I don't have time for an overall study of perl currently.
    So what I am doing is making the modification of the existing codes,
    which turns to be a good way for me to study perl.
    I post the simplified codes this time, hope it wont take much time for you to go through.
    Thanks a lot!!!

    Parser.xs Paser.pm TrialParser.pl Can't locate auto/Trialparser/class.al in @INC (@INC contains: /cygdrive/d/parser/blib/arch /cygdrive/d/parser/blib/lib /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/cygwin /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/cygwin /usr/lib/perl5/vendor_perl/5.8 .) at /cygdrive/d/parser/blib/lib/Parser.pm line 51
    Error comes from Parser.pm in Line 51:
    $self->_read_xs($param{filename}, $param{strip_autos}||$self->{strip_autos});

      Oh, the error is coming from the XSUB. It looks like you're missing the MODULE directive there. Before _read_xs, add the line:

      MODULE = Trialparser  PACKAGE = Trialparser

      ... and see if that fixes things. (It's an untested guess.)