Re: Need some help...

Phil Whelan <[email protected]>
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
Hi Doug,

> It looks to me that the OBJECT constant is from POE is being interfered with
> by the OBJECT constant from Params::Validate.  After removing the validate
> method, the code seems to run OK.

I think you need one of these...

    use POE::Session;

I usually find the POE constants are not imported unless I use this.

Cheers,
Phil

On Mon, Jun 15, 2009 at 9:28 AM, Doug Greer<[email protected]> wrote:
> Hey all,
>
> I'm just starting to learn POE, so I tried running the attached code and got
> this warning:
> Constant subroutine Controller::OBJECT redefined at
> /usr/local/lib/perl5/site_perl/5.8.8/i686-linux/Params/Validate.pm line 5
>
> It looks to me that the OBJECT constant is from POE is being interfered with
> by the OBJECT constant from Params::Validate.  After removing the validate
> method, the code seems to run OK.
>
> Output from the code:
>
> Dump params: $VAR1 = {
>           'Alias' => 'lamp',
>           'Address' => 'aa.aa.aa',
>           'Description' => 'Lamp'
>         };
>
>
> $VAR1 = 'new object';
> $VAR2 = bless( {
>                  'address' => 'AA.AA.AA'
>                }, 'Controller' );
> $VAR1 = 'in _start, want object, heap';
> $VAR2 = bless( {
>                  'address' => 'AA.AA.AA'
>                }, 'Controller' );
> $VAR3 = {
>           'description' => 'Lamp',
>           'alias' => 'lamp'
>         };
> $VAR1 = 'dump of session';
> $VAR2 = bless( [
>                  {
>                    'description' => 'Lamp',
>                    'alias' => 'lamp'
>                  },
>                  {},
>                  {
>                    '_start' => [
>                                  bless( {
>                                           'address' => 'AA.AA.AA'
>                                         }, 'Controller' ),
>                                  '_start'
>                                ]
>                  }
>                ], 'POE::Session' );
>
>
>
> Sincerely,
> Doug Greer
>
>
>
> On Sat, Jun 13, 2009 at 8:47 PM, Rob Fugina <[email protected]> wrote:
>>
>> I'm attaching my actual module, minus the path (for your convenience),
>> and a test script that demonstrates the error.  It doesn't suffer from
>> the original array slice problem.  I've done this before (object
>> states, that is), but they were fragile even then -- or they are now,
>> anyway.  I'm sure there's something simple or stupid I'm missing...
>>
>> Rob
>
>



-- 
Mobile: +1  778-233-4935
Website: http://philw.co.uk
Skype: philwhelan76
Twitter: philwhln
Email : [email protected]
iChat: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.