Skip Menu |

This queue is for tickets about the POE-Session-AttributeBased CPAN distribution.

Report information
The Basics
Id: 20912
Status: resolved
Priority: 0/
Queue: POE-Session-AttributeBased

People
Owner: chris [...] fedde.us
Requestors: RCAPUTO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: To consider: :Self, :Arg, and :Member attributes from POE::Stage tinkering
In a fit of temporary (?) insanity, I decided that I hated @_, $self->{member}, so I wrote handlers for :Self and :Member attributes to sweeten their syntax a little: my $self :Self; # my $self = $_[0]; my $member :Memb; # my $member = $self->{member}; The code is rather simple. You're free to incorporate it into POE::Session::AttributeBased. I think you'll be able to retool it easily for various @_ offsets and $_[HEAP] members, at the very least. Sample usage: http://thirdlobe.com/projects/poe-stage/browser/trunk/lab/sweet-at-under.perl Attribute handlers: http://thirdlobe.com/projects/poe-stage/browser/trunk/lab/SweetAtUnder.pm
On Wed Aug 09 11:45:40 2006, RCAPUTO wrote: Show quoted text
> In a fit of temporary (?) insanity, I decided that I hated @_, > $self->{member}, so I wrote handlers for :Self and :Member attributes > to > sweeten their syntax a little: > > my $self :Self; # my $self = $_[0]; > my $member :Memb; # my $member = $self->{member}; > > The code is rather simple. You're free to incorporate it into > POE::Session::AttributeBased. I think you'll be able to retool it > easily for various @_ offsets and $_[HEAP] members, at the very least. > > Sample usage: > http://thirdlobe.com/projects/poe-stage/browser/trunk/lab/sweet-at- > under.perl > > Attribute handlers: > http://thirdlobe.com/projects/poe- > stage/browser/trunk/lab/SweetAtUnder.pm
I've done up and submitted another version of POE::Session::AttributeBased that has this kind of syntactic sugar. I'm a bit concerned about mucking about with the DB class to get at the offsets via caller. But hey. that which works is finished.