Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How Do I Bundle Perl Modules and Their Tests Into the Same File?

by BrowserUk (Patriarch)
on Feb 13, 2006 at 00:39 UTC ( #529714=note: print w/replies, xml ) Need Help??


in reply to How Do I Bundle Perl Modules and Their Tests Into the Same File?

package abc; ... return 1 if caller; package main; my $abc = abc->new(); ...

To run the tests, use

perl \path\to\lib\abc.pm

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: How Do I Bundle Perl Modules and Their Tests Into the Same File?
by salva (Canon) on Feb 13, 2006 at 08:45 UTC
    would this work if the module is required, from a sub? for instance:
    sub foo { require abc; abc->bar(); }

      Yes.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://529714]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2023-06-08 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (29 votes). Check out past polls.

    Notices?