go ahead... be a heretic | |
PerlMonks |
Re: How to detect a hash container key from a referenced sub valueby FalseVinylShrub (Chaplain) |
on Dec 03, 2009 at 05:58 UTC ( [id://810755]=note: print w/replies, xml ) | Need Help?? |
Hi Forgive me if I've missed something obvious, but why don't you just create a subroutine that accepts a hash and calculates the sum:
Seems like you're trying to do something in a somewhat object-oriented way. If you want to do that, you should look into making actual objects which comes with mechanisms for the method to know which object it was called on:
If that looks like what you're trying to do, you need to read up on Perl OO... I suggest you post again if you need pointers on where to start. Edits:
HTH FalseVinylShrub N.B. Please review and test code, and use at your own risk... If I answer a question, I would like to hear if and how you solved your problem.
In Section
Seekers of Perl Wisdom
|
|