in reply to how to use Data::Dumper inside a module?

And as for why it didn't work, look at this output:

$ cat Spoo.pm print "pre package: ", __PACKAGE__, "\n"; package Spoo; print "post package: ", __PACKAGE__, "\n"; 1; $ perl -MSpoo -e 0 pre package: main post package: Spoo

In your code your use Data::Dumper line (which is implicitly running Data::Dumper->import()) is being executed in the main package. When you subsequently try and use Dumper() Perl sees an unqualified sub name (since it didn't get imported into Misc::Test) and gripes.