Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Pod::Coverage for helper classes

by bliako (Monsignor)
on Feb 02, 2021 at 10:44 UTC ( [id://11127805]=note: print w/replies, xml ) Need Help??


in reply to Pod::Coverage for helper classes

Could multiple packages in the same file be confusing to Pod::Coverage? use takes as parameter a Package name and then it infers the filename it should be living in and attempts to open it through the INC. Essentially, use needs the package name to be living in a similarly named file. So, in your case doing use Segment; will read Segment.pm and load all there is in it. Fine. But will you be able to access/refer-to the other packages?

When said file contains two or more packages how can you access (e.g. File::ELF::Describe()) any of them except the one you named in the use? Of course you can resort to all sorts of hacks perhaps through require or dynamically injecting into the %%%%%%%INC. But Pod::Coverage may not be so hacky, especially if it does its enquiries not by parsing module files but by use'ing them (my guess).

That said, multiple-packages-in-one-file works fine if you want to use them within the same file, as kind of private modules. But to keep my mind peaceful I am always enclosing each package in its own block.

bw, bliako

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found