Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thanks haukex for your crystalline suggestions,

now I see: a module returning 0 will be automatically removed from %INC while a module that explicitly die will be not:

echo die > Whatever.pm perl -wMstrict -MData::Dump -I. -e "my $ret;eval {$ret=require Whatev +er};dd $ret; dd %$INC{$_} for grep{/Whatever/} keys %INC;" undef # <--- require returned value ("Whatever.pm", undef) # die in the module will leaves the entry in % +INC echo 0 > Whatever.pm perl -wMstrict -MData::Dump -I. -e "my $ret;eval {$ret=require Whatev +er};dd $ret; dd %$INC{$_} for grep{/Whatever/} keys %INC;" undef # <--- require returned value

So i have no chanche at all to make the require or use to fail (in the right, intended way, aka leaving %INC clean)?

Yes you pointed to the right source of Win32::Backup::Robocopy (thanks!) but as I'm now git aware ( ;) the env branch was not online: now is there

Definitevely put the check in the new is better: but I'd avoid the our solution: are not to avoid these in modules? In the new call I can put a _check_robocopy but definetively I have to die or croack if what is set in %ENV is invalid.

In the test I have to delete from %INC anyway..

Thanks!

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re^2: Error: Attempt to reload module.. while testing failing require by Discipulus
in thread Error: Attempt to reload module.. while testing failing require by Discipulus

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 avoiding work at the Monastery: (7)
As of 2024-04-23 07:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found