Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^5: RFC: Tutorial: use strict; now what!?

by chromatic (Archbishop)
on Feb 08, 2012 at 18:58 UTC ( #952558=note: print w/replies, xml ) Need Help??

in reply to Re^4: RFC: Tutorial: use strict; now what!?
in thread RFC: Tutorial: use strict; now what!?

This may point to your error (along with a bunch of other non-errors);...

... and a bunch of warnings in other places that aren't under your control. warnings has a lexical scope, while -w and -W affect the entire process.

Replies are listed 'Best First'.
Re^6: RFC: Tutorial: use strict; now what!?
by educated_foo (Vicar) on Feb 08, 2012 at 19:08 UTC
    ...and? Let's say you tried to log something undefined, so you passed it to your logging module. With "use warnings", you would see nothing; with "-w", you would get a message. Which do you prefer? (Or, perhaps, which is more "Modern"?)
      Which do you prefer?

      The version which respects encapsulation boundaries, of course.

      With "use warnings", you would see nothing; with "-w", you would get a message.

      Nope; my logging module uses warnings and reports only what's relevant.

        Okay, let's say you want to log undef as an empty string. Tragically, your "encapsulation boundaries" make this impossible. Oh, well.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952558]
[choroba]: His reply was "I watch them, but I haven't been impressed in the last 10 years. There's been nothing new". That was 2 years ago :)
[ambrus]: Ok, the docs is somewhat unclear. It does say that when an object is garbage collected, it will get cleaned up, and eventually can no longer get messages. It's not clear how long this takes, eg. I think it's kept alive until its queued events are handled
[ambrus]: in the loop, and I'm not sure if that's ok for AnyEvent. Also, it's not clear if a Timer or File object you free really is garbage collected, i.e. that Prima doesn't keep some references to it, but I hope so.
[Corion]: choroba: No, I don't remember that story, but yes, it matches my experience ;))
[ambrus]: Hopefull the object isn't kept alive, the events are processed immediately, but you'd have to read a lot of source code to be sure about that.
[Corion]: ambrus: I think both of AnyEvent and Prima are pretty tight in their memory management because they both are cooperative multitasking and (I think) both use the Perl memory management for managing things
[Corion]: ambrus: And for Windows, I don't think that Prima knows if there still are messages queued for an object (in the Windows message loop). Finding that out would take lots of effort for little gain
[ambrus]: And even if this works, I'm still not sure you can't get double timeouts from a Timer.
[ambrus]: Corion: well Prima::Object says something like that the cleanup method will send an onDestory message and that you can't get more messages after cleanup, or something.
[Corion]: ambrus: Yeah - I don't think the deep source dive will be necessary if things are implemented as simple as they could be :)) And hopefully I won't need (more) timely object destruction. I can update the screen at 60Hz and hopefully even do HTTP ...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2016-12-09 10:23 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (150 votes). Check out past polls.