Subject: | Bug related to improper use AutotLoader in DFA::Simple |
Hello,
I came accross this module when I was trying to implement a state machine for a parsing problem. I used this module because of the simplicity it offered. However there is a small problem in the module. The module is inheriting from AutoLoader which is incorrect since it will cause another module that is trying to use DFA::Simple to fail. Please take a look at the following code.
$ cat Test.pm
package Test;
use strict;
use warnings "all";
use DFA::Simple;
1;
$ perl -I /u/mallis/src/scripts/perl -e 'use Test;'
Can't locate auto/Test/autosplit.ix in @INC (@INC contains:
/u/mallis/src/scripts/perl /usr/local/lib/perl5/5.6.1/sun4-solaris
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
/usr/local/lib/perl5/site_perl/5.6.1
/prod/tools/packages/lib/perl5/5.6.1/sun4-solaris
/prod/tools/packages/lib/perl5/5.6.1 .) at
/usr/local/lib/perl5/5.6.1/sun4-solaris/AutoLoader.pm line 146.
at /u/mallis/src/scripts/perl/Test.pm line 7
This happens because 'use DFA::Simple' will call DFA::Simple::import (which will be AutoLoader's import() because of the @ISA = qw(AutoLoader) in DFA::Simple) and it will search for the .ix files for Test which is irrelevent.
The solution is just to remove the @ISA = qw(AutoLoader) from DFA::Simple, which will help me to use the module.
Show quoted text
----- Other information -----
DFA::Simple version : DFA-Simple-0.32
Perl Verion:
$ perl -v
This is perl, v5.6.1 built for sun4-solaris
OS:
$ uname -a
SunOS infra2c.hyd.deshaw.com 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-280R Solaris
=============================
Thanks much!
Siva