in reply to Interesting Use for "state" Variables
Now do your manipulations on the hash, and set the values accordingly?my %hash; my $count = 0; foreach my $key qw(red blue green yellow black white purple brown orange gray){ $hash{$key}{'index'} = $count; $hash{$key}{'state'} = 0; $count ++; }
|
|---|