Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: using POE::Component::IRC

by Mr_Person (Hermit)
on Aug 13, 2004 at 21:10 UTC ( #382845=note: print w/replies, xml ) Need Help??


in reply to using POE::Component::IRC

The problem is that you're assigning a new hash reference to $heap in _start. Let's see if I can explain this correctly...

The _start sub gets called with a reference to the heap, stored internally by POE. You then store this reference in $heap and can then view or modify the real heap, but only through it's reference. In your code, you create an anonymous hash reference and assign it to $heap. This overwrites the reference that was in $heap pointing to the real "heap" location with a temporary one that goes out of scope when your sub exits. End result, it works fine within the _start sub, but after that all the changes mysteriously disappear.

What you need to do is keep the reference in tact when you assign new values to it, with something like this:

%$heap = ( PARAMS => { NICK => "", CONNECTED => 0, } );

Hope that helps!

Replies are listed 'Best First'.
Re^2: using POE::Component::IRC
by b888 (Beadle) on Aug 16, 2004 at 10:15 UTC
    That definitly helps. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://382845]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2023-09-25 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?