LanX has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Inline" module testing?
by Arunbear (Prior) on Aug 15, 2017 at 10:35 UTC | |
by LanX (Saint) on Aug 15, 2017 at 16:07 UTC | |
by Anonymous Monk on Aug 15, 2017 at 17:21 UTC | |
by LanX (Saint) on Aug 15, 2017 at 17:45 UTC | |
|
Re: "Inline" module testing?
by Anonymous Monk on Aug 15, 2017 at 00:42 UTC | |
by LanX (Saint) on Aug 15, 2017 at 00:59 UTC | |
by Anonymous Monk on Aug 15, 2017 at 01:49 UTC |