Hi-
I have a double hash and am trying to do a foreach (sort) on the inner hash.
This code doesn't want to work. Any ideas?
my $from_state,$to_state;
foreach $from_state (sort keys %rt::states) {
foreach $to_state (sort keys %rt::states{$from_state}) {
it bombs on the syntax of the 2nd foreach statement.
The hashes are valid and defined and work.
warn "$rt::states{'one'}{'two'}{'data'}";
^^^-- this will output the correct data that has been set into it.
Any ideas?
-TIA!
--Mike Robb
I have a double hash and am trying to do a foreach (sort) on the inner hash.
This code doesn't want to work. Any ideas?
my $from_state,$to_state;
foreach $from_state (sort keys %rt::states) {
foreach $to_state (sort keys %rt::states{$from_state}) {
it bombs on the syntax of the 2nd foreach statement.
The hashes are valid and defined and work.
warn "$rt::states{'one'}{'two'}{'data'}";
^^^-- this will output the correct data that has been set into it.
Any ideas?
-TIA!
--Mike Robb