Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: attempt to reload My_module.pm aborted

by prashanttekriwal (Novice)
on Apr 18, 2013 at 18:36 UTC ( #1029404=note: print w/replies, xml ) Need Help??


in reply to attempt to reload My_module.pm aborted

Hi all,

Thanks for the replies.

Actually I don't know how the users are using their script even though the module is failing to load.
Since it has been working earlier with perl5.8.8, I had to make it work for perl 5.14 as it is really difficult to figure out where the first attempt is failing.

I was able to get around the issue by doing this:
eval { require Module; }; my $error = $@; if ($error && $error =~ /attempt to reload/i){ delete $INC{'Module'}; require Module; } else{ die $error; }
and its working fine as it was earlier.

I know this seems to be a very tedious hack but then there is no other way I could think of since I can't comment the 'use' statement.

I appreciate all the replies I got.

Thanks again,
Prashant

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029404]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2018-07-18 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (393 votes). Check out past polls.

    Notices?