in reply to Re^3: Variable Name Mistery. Who calls?
in thread Variable Name Mistery. Who calls?

It's almost there. this is the output I've got: ~$ perl p.pl This will work This will work as well Couldn't execute three at p.pl line 9 And, what I want to achieve is to print (for example) which variable raised that warning. Something like this: Couldn't execute three on $o at p.pl line 9 Perhaps am I asking to much?
  • Comment on Re^4: Variable Name Mistery. Who calls?

Replies are listed 'Best First'.
Re^5: Variable Name Mistery. Who calls?
by ikegami (Patriarch) on Oct 26, 2006 at 02:19 UTC

    Well, you could use PadWalker's var_name. var_name won't always work, though.

    Before using PadWalker, ask yourself if you really think the tiny bit of extra usefulness to help debug the rare situation where a non-existant function is called more than once in a given statement is really worth the extra work, complexity and maintenance issues of displaying the variable's name (when there might not even be one).