> Constant subroutine main::STATE redefined at
 > /Library/Perl/5.8.1/POE/NFA.pm line 131.
 >
Here's the program, with lines numbered:

      3  use POE;
      4  use POE::NFA;

The problem occurs here. C<use POE> quietly uses POE::Kernel and POE::Session. POE::Session imports a number of constants to make life easier, including KERNEL, HEAP, STATE, ARG0, and so on.

When you use POE::NFA separately, it also tries to import some
constants, including KERNEL, HEAP, STATE, ARG0, and so on.  The result
is a number of "redefined" warnings.

Thanks for the reply, Rocco! Does that mean I should be leaving out line 3 or line 4 above? They both seem to be required -- I get runtime or compilation errors if I leave one out. Or am I doing the right thing by using them both, and just ignoring that "redefined" warning?


By the way, POE::NFA is awesome! I'm just starting to use it, but it has already saved me tons of work. It doesn't seem to get as much press as its sibling module POE::Session, and in fact I can't find an example anywhere online of a program that uses it, but I'm a big fan! Rock on.

Tim Klein
Dallas, Texas




Reply via email to