in reply to An error in using XS

Line 51 of your Parser module attempts to call an undefined subroutine class. You didn't show that piece of code, but it's almost certainly wrong.

This error message is likely due to the use of AutoLoader somewhere, which installs an AUTOLOAD() subroutine to catch calls to undefined functions. It then attempts to load the files containing those subroutines. There's no really good reason to do this normally.

Replies are listed 'Best First'.
Re^2: An error in using XS
by ming_322 (Initiate) on Jul 11, 2006 at 05:26 UTC
    There is no AutoLoader used in my codes. I post whole codes this time, please check it again. Thank you so much! Parser.pm Parser.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}
        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});