sunshine_august has asked for the wisdom of the Perl Monks concerning the following question:
I am learning POE, and I am confused about POE::Session's parameter HEAP.
I notice that POE::Session use its parameter HEAP like a hash, but I think HEAP should be a reference, and it is documented: " Heaps are by default anonymous hash references":
The example from its document:why does it usesub _start_handler { $_[HEAP]{ts_start} = time(); }
rather than$_[HEAP]{ts_start} = time();
$_[HEAP]->{ts_start} = time();
I think the $_[HEAP] should be a reference, it can't not be use like $_[HEAP]{ts_start}, but in POE::Session, it did use like this way and it did work well.
Can anyone give a tip?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can POE use a hash reference like a hash?
by rcaputo (Chaplain) on Dec 11, 2008 at 06:05 UTC | |
by Bloodnok (Vicar) on Dec 11, 2008 at 17:13 UTC | |
by rcaputo (Chaplain) on Dec 27, 2008 at 15:48 UTC |