in reply to module problems

The interpreter (or myself) is doing something weird. For example, if I add another sub to the module "my_mod.pm":
sub daddy{ print "Hi, Dad!!!\n"};
I get the same error again when calling it in "dog", but I get it even when
my_mod::daddy();
is used.

Replies are listed 'Best First'.
Re^2: module problems
by wade (Pilgrim) on Apr 03, 2008 at 18:47 UTC
    I think we need to see the new code in situ -- as described, it sounds like it should work.
    --
    Wade
      my_mod.pm:
      package my_mod; sub cat{ print "meeow.\n"; } sub daddy{ print "Hi, Dad!!!\n";} 1;
      Here is dog:
      #!/usr/bin/env perl use my_mod; my_mod::cat(); my_mod::daddy();
      I tried this exact same on a separate box with a (presumably) different Perl interpreter, and it seemed to work just fine. Could it be something weird going on with the cygwin perl interpreter? And speaking of which, is there any way I could obtain Perl (at least an interpeter, compiler) for Windows (without having to use ActiveState Perl, for which I must eventually pay money)? The Perl interpreter that comes with cygwin is, to say the least, a little squirrelly (okay, maybe my code is too, but still...).
        I tried it (ActiveState Perl on WindowsXP) -- works for me.
        --
        Wade