You are looking for hashes.
my $max = {}; $max->{george}->{money} = 100; $max->{george}->{budget} = 100; my $person = "lindsay"; $max->{$person}->{money} = 1500; $max->{$person}->{budget} = 2000; for ("george","lindsay") { print "$_ 's money= " . $max->{$_}->{money} . "\n"; }
In reply to Re: Dynamic variables
by eric256
in thread Dynamic variables
by xspikx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |