I cannot answer your question, because you have changed your post so that it no longer says what you are looking for. Moreover, any monk who reads your question after this point will have the same problem. Updating your posts with further comments and corrections is fine. Updating your post to delete the question you originally asked is not fine, so please don't do it.
Nevertheless I will guess that your question concerns why the code as you have it now does not print out "hi there" and moreover returns an error Not a HASH reference at - line 27. The reason is that the value returned by first is not a reference to the hash %objREF but rather a reference to a scalar value, containing a string, which so happens to be the third element of an array that has fallen out of scope. If you wrote your code for two as
you would see the desired result. If you added the linemy $objREF = shift; print $$objREF;
to the end of first then the linereturn \%objREF;
would be the correct way to print it out from two.print ${$objREF->{poker}}
Update: This reply refers to the modified version of the node, before the original was restored, but I am leaving it in place for safe-keeping. Thanks castaway and janitors.
In reply to Re: code sample: possible improvements
by Errto
in thread code sample: possible improvements
by arcnon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |