Garrett Goebel wrote:
> Rocco Caputo wrote:
> > Sent: Tuesday, November 12, 2002 10:40 AM
> > On Mon, Nov 11, 2002 at 06:00:52PM -0600, Garrett Goebel wrote:
> > > I noticed at:
> > > http://poe.perl.org/?POE_RFCs/Lexical_state_parameters
> > >
> > > That there was a desire to: "Turn @_[KERNEL, HEAP, etc.]
> > > into regular variables, somehow"
> > >
> > > Attached and also inlined at the bottom, you'll find
> [...]
> >
> > I like the simplicity of this syntax. Rather than patching
> > Session.pm, I recommend subclassing it in the same vein as
> > http://poe.perl.org/?POE_RFCs/Named_state_parameters
>
> Okay, I'll take a look at doing this...
If I'm going to go so far as to subclass it... I think I'll go a little
father and attempt to remove all the special parameters from being passed
during state invokation. Then you might have something like:
POE::Session->new(
inline_state => sub {
my (@args) = @_;
heap->{args} = \@args;
kernel->yield('object_state');
},
$object => ['object_state'],
);
sub object_state {
my ($self, @args) = @_;
...
}
--
Garrett Goebel
IS Development Specialist
ScriptPro Direct: 913.403.5261
5828 Reeds Road Main: 913.384.1008
Mission, KS 66202 Fax: 913.384.2180
www.scriptpro.com [EMAIL PROTECTED]