When you do use Test::More in a test script, what you're doing is importing all Test::More's functions (including diag) into the main package, so it can be accessed as main::diag instead of Test::More::diag.
The first paragraph of perlmod tells us that ::foo is a shorthand for main::foo.
Thus ::diag works everywhere in your modules, provided something has happened to import Test::More into main (most likely: you are running your module through its test suite).
In reply to Re^6: "warn" is your best friend
by tobyink
in thread "warn" is your best friend
by snax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |