in reply to Re: Error: Attempt to reload module.. while testing failing require
in thread Error: Attempt to reload module.. while testing failing require
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*
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Error: Attempt to reload module.. while testing failing require
by haukex (Archbishop) on Jan 21, 2019 at 10:27 UTC |