in reply to Re^2: Counting devices types, device sizes and number of devices.
in thread Counting devices types, device sizes and number of devices.

use Data::Dumper; while (<DATA>) { chomp; @F = split /\t/; # <== place proper delimiter or regex $devices{$F[4]}{$F[-1]}++; } $Data::Dumper::Sortkeys = 1; print Dumper \%devices; # accessing for $type (sort keys %devices) { for $size (sort {$a <=> $b} keys %{$devices{$type}}) { print "$type $size $devices{$type}{$size} \n"; } }
- J

Replies are listed 'Best First'.
Re^4: Counting devices types, device sizes and number of devices.
by perl514 (Pilgrim) on Jan 03, 2012 at 08:49 UTC

    Hi Jaimon,

    Thanks a lot. But thing is, the output given in my post is output of a command.Does Data Dumper have the facility to take in command output?

    Perlpetually Indebted To PerlMonks