Hmm %{$_} works for me?
######################
#!/usr/local/bin/perl
my @a=qw(hash_one hash_two hash_three);
my $i=0;
foreach (@a){
%{$_}=('name'=>$_,'val'=>$i++);
}
foreach (@a){
print %{$_},"\n";
}
######################
-----Original Message-----
From: Peter Eisengrein [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 14, 2001 11:44 AM
To: Perl-Win32-Users Mailing List (E-mail)
Subject: @$_ works, so why doesn't %$_ ?
Aaarggghhhhh. This is making me nutty! I have several hashes that I want to
process identically, so I put their names in an array and want to call those
names iteratively from the array. But I just can't get it to work. Please
help!
### here's what I am trying to do:
my @list = ("hash_one","hash_two","hash_three");
foreach (@list)
{
### now process %$_ which I want to be
### %hash_one
### then %hash_two
### then %hash_three
}
I've used @$_ before, so why doesn't %$_ work? I've tried...
%$_
%{$_}
%${_}
%{${_}}
%\$_
%(eval($_))
... and every other combination I can think of. I'll just be here banging my
head on my desk........
Thanks group.
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users