Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Reloading modules- suppressing warnings works sometimes?

by JPaul (Hermit)
on Dec 21, 2003 at 20:02 UTC ( [id://316232]=note: print w/replies, xml ) Need Help??


in reply to Reloading modules- suppressing warnings works sometimes?

So - what have we all learned?

That it certainly pays to show a little more attention when copying things into PM questions - and more importantly, in looking at the differences between the modules in question in my case.
The basic issue shown is that the eval'led reload module overrides the local suppression of warnings, as it should. I thank the monks for explaining this to me, I was kinda there, but not quite.

However - the reason foo did not warn in my local examples - tested before posting - was simply because I didn't have 'use warnings;' in that code - and didn't spot that it wasn't there, ridiculously enough. And, in my haste, I manually typed the examples into my SOPW question - and magically added the 'use warnings;' which was the entire crux of the issue. Like, duh.

JP,
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --

  • Comment on Re: Reloading modules- suppressing warnings works sometimes?

Replies are listed 'Best First'.
Re: Re: Reloading modules- suppressing warnings works sometimes?
by theorbtwo (Prior) on Dec 21, 2003 at 20:41 UTC

    Hm, it would appear that you'll get these warnings in any module that does a use warings;, which /should/ be most modules. The fact that your module is apparently the only one that you tried that does that is rather sad, actualy.

    But removing the "use warnings" from reload.pm is clearly not a general solution, if this is indeed the problem. What happened, BTW, to my proposed (in the CB) solution of stealing Text::Template's _scrubpkg sub?


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      Not sad - forgetful!
      I usually have strict/warnings in all scripts/modules, by default - Lord only knows how I managed to forget in the handful of modules that I've been using with this reloadable method.

      As for Text::Template's _scrubpkg, this much like !1's idea, looks like real voodoo to me - but thats simply because I don't "get it". Thats not to say I won't try it - I just haven't yet :)

      Thanks all;
      JP,
      -- Alexander Widdlemouse undid his bellybutton and his bum dropped off --

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-23 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found