What you have there is fine. Although, if you don't need it for anything else, you can eliminate @hierarchy and shorten the code a bit. Don't forget warnings too.
#!/usr/bin/env perl use strict; use warnings; my $order = 0; my %hierarchy; $hierarchy{$_} = $order++ for @ARGV; while( my( $key, $value ) = each %hierarchy ){ print "$key: $value\n"; }
In reply to Re: HASH Hierarchy
by hippo
in thread HASH Hierarchy
by dirtdog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |