Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I see. I guess that makes (some) sense.

How about this approach, then:

As Eliya mentioned, use Utils1; is equivalent to

BEGIN { require Utils1; Utils1->import; }
You should, therefore, be able to make the import from the Utils package transparent by editing Utils1.pm to do something along the lines of
package Utils1; sub import { Utils->export_to_level(1, @_); } package Utils; ...
This will (assuming I remembered the incantation correctly) make Utils1->import equivalent to Utils->import.


Although, really, the better approach would likely be to put the two versions of Utils.pm into different library directories (e.g., /usr/local/devel/Utils.pm and /usr/local/stable/Utils.pm), then manipulating @INC (by setting PERL5LIB in the shell or with use lib in the code) so that each program will load the appropriate version.


In reply to Re^3: PERL modules named differently than the package won't export by dsheroh
in thread PERL modules named differently than the package won't export by kovacsbv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (9)
As of 2024-04-19 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found