in reply to Command output into a hash of hash
my %name; my $cur_name; while(<YOUR_FILE>){ chomp; my ($key,$value) = split(/:\s{2}/,$_); if ($key !~ /^$/){ if ($key =~ /^Name/){ $cur_name = $value }else{ push @{$name{$cur_name}{$key}},$value; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Command output into a hash of hash
by mrras25 (Acolyte) on Nov 20, 2009 at 00:46 UTC |