tcf03 has asked for the wisdom of the Perl Monks concerning the following question:
using print Dumper - I get what I need - its printing it out w/o Dumper that Im having issues withforeach my $row ($te->rows) { my $count = 0; foreach my $item (@$row) { $count++; chomp($item); $$row[0] =~ s/(.*)_.*/$1/; # HOST $$row[1] =~ s/LSS: 0x0*(.*)/$1/; # LSS $$row[2] =~ s/(.*)-.*/$1/; # LUN $$row[3] =~ s/^0*(.*) GB/$1/; # Size in GB push ( @{$map{$$row[1]}{$$row[2]}}, $$row[0] ) unless $known{$ +$row[1]}{$$row[2]}{$$row[0]}++; } } print Dumper %map;
LSS1
LUN1
HOST1
HOST2
HOST3
LUN2
HOST1
HOST3
LSS2
for my $LSS ( sort keys %map ) { print "LSS: $LSS\n"; for my $LUNS ( sort keys %{ $map{$LSS} } ) { print " LUN: $LUNS LSS: $LSS\n\n"; for my $hosts ( sort @{ $map{$LSS}{$LUNS} } ) { print " $hosts\n"; } print "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pulling data from a complex structure
by GrandFather (Saint) on Jan 23, 2006 at 21:04 UTC | |
|
Re: pulling data from a complex structure
by BrowserUk (Patriarch) on Jan 23, 2006 at 20:36 UTC | |
|
Re: pulling data from a complex structure
by planetscape (Chancellor) on Jan 24, 2006 at 06:12 UTC |