in reply to How does one get the name of a passed scalar?
Ah, the best I could come up with for that was an editor macro that inserts: print "$_=(".eval($_).")\n" for qw( ); and then you type any variable names you like into the qw() part.
BTW, you can't just make this a Perl function as most variables of most worth-while programs won't be available for the subroutine to access by using eval on their name.
Also, if you want this to work for arrays as well: print "$_=(".eval(qq("$_")).")\n" for qw( ); and if you want this to work for hashes and other types of expressions: print "$_=(".join(",",eval$_).")\n" for qw( ); so I'd probably just use that last one.
- tye (but my friends call me "Tye")
|
|---|