How can I write either show1() or show2() so that STDOUT displays this:sub show1 { ... } sub show2 { ... } my $a = 'foo'; show1($a); show2('$a');
This is trivial in C/C++ using macros, but I can't figure out how to write either show1() or show2() so that it knows the name and value of the variable passed to it from a different scope.$a = 'foo'
In reply to Displaying a variable's name and value in a sub by Smile-n-Nod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |