in reply to global function decleration
package SomePM; use OtherPackage; OtherPackege::some_func(); # works
I sometimes do this in my projects for debugging:
sub ::D { require Data::Dumper; return Data::Dumper::Dumper(@_) } sub ::DD { require Carp; Carp::confess(::D(@_)) } # later, call it like this: print ::D({ current_state => $state }); # debug print ::DD($state); # dump, stack trace, die.
If you have the cooperation of the other modules, have them use your module, and write an import routine to export your functions to the calling namespaces.
|
|---|