I came up with the following code for module testing in one file.
(Most probably saw something similar before)
prints use_test->import( use_test, 1, 2, 3 ) called at c:/tmp/use_test.pl line 9.use strict; use warnings; package use_test; sub import { local $"=", "; warn __PACKAGE__."->import( @_ ) called"; } BEGIN { $INC{__PACKAGE__.".pm"} = 1 } # mark as loaded package test; use use_test 1,2,3;
Is there an easier way to do it? :)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to "Inline" module testing? by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |