adjohan has asked for the wisdom of the Perl Monks concerning the following question:

I'm creating a module let say FOO.pm which uses DFA::Simple, i.e.
package FOO; use DFA::Simple; use strict;
And when I'm trying to "use FOO" in my main script, I got error message: Can't located auto/FOO/sutosplit.ix in @INC

I'm confused why? I'm tried perl 5.8.3 on my pc as well as on solaris, and they both gave the same error message.

Any help would be appreciated!

Thanks,
Adrianus

Replies are listed 'Best First'.
Re: Creating a module with DFA::Simple
by adjohan (Novice) on Feb 24, 2005 at 12:49 UTC
    I found out from CPAN forum that there is a bug in the DFA::Simple module. See http://rt.cpan.org/NoAuth/Bug.html?id=8225.
Re: Creating a module with DFA::Simple
by perlfan (Parson) on Feb 24, 2005 at 04:46 UTC
    What does this have to do with DFA::Simple? Try a test script - i.e., a ".pl", that uses DFA::Simple just to eliminate that as the cause. Then look at Simple Module Tutorial for how to create a module.
      The error is definitely related to "use DFA::Simple", if I use other module: PDL, PDL::Complex, Tk, POSIX, Getopt::Long, etc, etc.... I don't get that message.

      Obviously, if I don't use DFA::Simple, I don't get the error either.

      Another info, if I use DFA::Simple not in another package, i.e. in main, it works... but I'm trying to create a module.

      Thanks!
      Adrianus

Re: Creating a module with DFA::Simple
by Ovid (Cardinal) on Feb 24, 2005 at 18:54 UTC

    Are you familiar with FSA::Rules? It's a good state machine and it's fairly well-documented. Also, if you have GraphViz installed, you can use it to show what your state machine looks like. This makes debugging much simpler. (Disclaimer: I'm one of the authors of FSA::Rules and I'm the guy who hacked in the GraphViz stuff, so I may be biased).

    Cheers,
    Ovid

    New address of my CGI Course.

      I will take a look at FSA::Rules

      Thanks for the suggestion!
      Adrianus

      Ovid,

      Do you know a good example using FSA::Rules for creating a parser?

      Thanks!
      Adrianus

        Regrettably, no, though it should be suitable for that. If I were you, I would define a very simple grammar (only two or three types of tokens) and try to build the parser from there. It should be relatively easy to port the state machine from this article to FSA::Rules. The nice thing is, if you have GraphViz installed, you can then print out the graph to see if it's equivalent to the diagram in the article:

        my $graph = $fsa->graph; print FH $graph->as_png;

        Cheers,
        Ovid

        New address of my CGI Course.