in the serie "why using moose and moosex" - today i present moosex::poe.
say you want to create a poe session. traditional way is to create a module handling spawn method that would be called as:
the module itself would be something like this:
now that's moutful. and it has an easy-to-miss error - found it? right, it's should be event3, not evnet3. you can curse poe quite some time trying to understand why your nice handler never gets called for event3.
here's the version using moosex::poe:
of course, it's still possible to mis-spell event3. however, you only have to spell it once, whereas you wrote it 3 times before - which is 2 times too much!
and i'm not talking about the easy accessors that could be added by moose - but i'm concentrating on moosex::poe here.
granted, there's one downside: subs are now anonymous, which can make it a bit harder to debug. but that's a small price to pay, imo.
so, moosex definitely makes your code more readable - i'm definitely not looking back, and i advise you to have a look too.