in reply to Re: Nervously....How do I access the Name of a Perl variable?
in thread Nervously....How do I access the Name of a Perl variable?


Here is a simple example using -P. The program should be run as follows perl -P program.pl and it requires a pre-processor on the target system:
#!/usr/bin/perl -w use strict; #define TRACE(x) print "$0 line ". __LINE__ .":\t". x ." = ". eval +(x). "\n"; my $foo = 7; TRACE('$foo'); $foo *= $foo; TRACE('$foo'); __END__ Prints: /tmp/test.pl line 8: $foo = 7 /tmp/test.pl line 11: $foo = 49

--
John.