in reply to Re^2: Undefined subroutine - newbie problem
in thread Undefined subroutine - newbie problem

blackhat:

From perldoc -f use:

  use Module VERSION LIST
  use Module VERSION
  use Module LIST
  use Module
  use VERSION
       Imports some semantics into the current package from the named
       module, generally by aliasing certain subroutine or variable
       names into your package.  It is exactly equivalent to

         BEGIN { require Module; Module->import( LIST ); }

       except that Module must be a bareword.

So you might try calling the import method for the package.

Alternatively, you can fully-qualify the call to include the package name, like: modules::gts::generate_throws_simple().

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^4: Undefined subroutine - newbie problem
by blackhat (Novice) on Aug 14, 2012 at 12:01 UTC
    well I don't really get that... my exc order says: "the program should also execute correctly when use statement is replaced with require";

    I thought, that it will be simple use > require swap + different variables reffs, but It seems much more complex for the moment

      blackhat:

      If you're trying to make it work the same way with use and require, try my second suggestion: use the fully qualified name when you call the function.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.