Re: getting literal name of a variable

2002-03-30 Thread Jonathan E. Paton
> I want to automatically print a variable's name. > > For example: > ### > #!/usr/bin/perl > use warnings; > use strict; > > my $string = '1,2,3,4'; > my @a = (my $var1, my $var2, my $var3, my $var4)= split (/,/, $string); > foreach my $element (@a) {print "eleme

RE: getting literal name of a variable

2002-03-30 Thread Wagner-David
Instead of trying that you would probably be better off using a hash and var1, vars2 as the keys. In the context that you are doing the split and assignment, I don't believe you will get the $var1, $var2, etc but the values of the split. Wags ;) -Original Message- From: zentara