|Welcome to the Monastery|
Variable Name Mistery. Who calls?by porta (Sexton)
|on Oct 25, 2006 at 16:26 UTC ( #580619=perlquestion: print w/replies, xml )||Need Help??|
porta has asked for the wisdom of the Perl Monks concerning the following question:
Hi to all. I'm a perl rookie and I started to struggle creating my own modules. I'm having a question that I cannot answer by myself and I ask for your Wisdom to trow some light on my dilemma.
Lets say that I create a module Foo.pm, which has "new" sub.
And, I have my script test.pl which has:
And my question is: Is there a way that I can, inside Foo.pm, know the name of the variable that I'm using on test.pl?
Lets say I want to create a sub on Foo.pm that just returns the name of $one or $second.
Note that I need this to be able to catch and display my own custom warnings on Foo.pm and I want to give the name of the variable that caused the warning when printing on screen the warning message.
I hope my question is clear enough. I'm not a good english speaker so please excuse any error on the writing. Thanks in advance for any help or comment about this.
Back to Seekers of Perl Wisdom