in reply to resolving variable names within variable names.
should do the trick.# after your first foreach loop foreach my $key (keys %var) { 1 while $var{$key} =~ s/([a-z_]+)/$var{$1}/; $var{$key} = eval "$var{$key}"; }
On another note - i would remove the first line in your
first foreach loop (the one with the tr) and change the
last line of that loop to:
UPDATE - or maybe not :) - i overlooked the fact that the
first few lines of the output have uppercase keys - my
mistake.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: resolving variable names within variable names.
by Octavian (Monk) on Jun 04, 2002 at 16:29 UTC |