For Programmers: Free Programming Magazines  


Home > Archive > PERL POE > June 2005 > Pseudo-hashes are depreciated error.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pseudo-hashes are depreciated error.
Jonathan Gill

2005-06-09, 4:00 am

Im trying to use a POE::Component::TCP::Client to send a single line to
a server (on a remote machine)

I send the message with a
$heap{server}->put($mymessage);

Sometimes it works fine, others it throws the following error

Pseudo-hashes are deprecated at tester line 467
No such pseudo-hash field "server" at tester line 467.

Anyone any ideas?

Thanks

Jonathan
--
Jonathan Gill

Rocco Caputo

2005-06-09, 4:00 am

On Fri, Apr 29, 2005 at 01:49:59AM +0800, Jonathan Gill wrote:
> Im trying to use a POE::Component::TCP::Client to send a single line to
> a server (on a remote machine)
>
> I send the message with a
> $heap{server}->put($mymessage);


Shouldn't that be $heap->{server}->put(...) ?

--
Rocco Caputo - http://poe.perl.org/
philip@awale.qc.ca

2005-06-09, 4:00 am


On 28-Apr-2005 Jonathan Gill wrote:
> Im trying to use a POE::Component::TCP::Client to send a single line to
> a server (on a remote machine)
>
> I send the message with a
> $heap{server}->put($mymessage);
>
> Sometimes it works fine, others it throws the following error
>
> Pseudo-hashes are deprecated at tester line 467
> No such pseudo-hash field "server" at tester line 467.
>
> Anyone any ideas?


$heap is generaly a hashref. That line should be
$heap->{searver}->put($mymessage);

or do you do %heap=%$heap at some point?

-Philip

Jonathan Gill

2005-06-09, 4:00 am

First, Appologies, my mail server decided to move, so can retrieve
emails at the moment, doign this via the archive.

> On Fri, Apr 29, 2005 at 01:49:59AM +0800, Jonathan Gill wrote:
[color=darkred]
> Shouldn't that be $heap->{server}->put(...) ?


My mistake, that is what I have, I didnt copy/paste but re-typed the line.

What I notice is (under 0.26 POE) I get a different error,
"Can't coerce array into hash"

The line I am trying to send is quite big, few 100s or chars, but other
lines seem to work perfectly well.

Any more clues as to where I should start looking?

Many thanks

Jonathan


Rocco Caputo

2005-06-09, 4:00 am

On Fri, Apr 29, 2005 at 11:38:07PM +0800, Jonathan Gill wrote:
> First, Appologies, my mail server decided to move, so can retrieve
> emails at the moment, doign this via the archive.
>
> What I notice is (under 0.26 POE) I get a different error,
> "Can't coerce array into hash"


$_[HEAP] shouldn't be an array reference unless you've done something
sneaky. Maybe you're saying:

my ($heap, @stuff) = @_;

It should be:

my ($heap, @stuff) = @_[HEAP, ARG0, ARG1, etc.];

Or you've otherwise mismatched the variables with their elements in @_ ?

--
Rocco Caputo - http://poe.perl.org/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com