Thanks for the update ... although I have to say, I like OO, and I don't like this. I've thought about investigating POE in the past - but something like this would drive me completely away from it. I would rather get named parameters than this. In fact, named parameters would be faster than this, too. I'm really not sure what they're trying to do with this - it's unintuitive, it's ugly, and it's slow. (Funny how that works in perl - often the intuitive, clean solutions are pretty darned close to the fastest, too.)

#! /usr/bin/perl use Benchmark qw(cmpthese); use constant {OBJECT => 0, KERNEL => 1, HEAP => 2, SESSION => 3, }; cmpthese( 0, { POE => sub { poe_style(qw(a b c d)); }, Normal => sub { regular_style(qw(a b c d)); }, Named => sub { named_style('a', kernel => 'b', heap => 'c', session => 'd', ); }, Shift => sub { shift_style(qw(a b c d)); }, } ); sub poe_style { my ($self, $kernel, $heap, $session) = @_[ OBJECT, KERNEL, HEAP, S +ESSION ]; 0; } sub regular_style { my $self = shift; my ($kernel, $heap, $session) = @_; 0; } sub named_style { my $self = shift; my %opts = @_; 0; } sub shift_style { my $self = shift; my $kernel = shift; my $heap = shift; my $session = shift; 0; }
Given all that POE has to do, This design decision seems crazy unintuitive to me.

Update:Typo fixed, changing the way the benchmark worked. Still find it ugly :-)


In reply to Re^3: POE OO sessions - accessing overwritten methods by Tanktalus
in thread POE OO sessions - accessing overwritten methods by m-rau

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.