use strict; use warnings; use Data::Dumper; my @filesys; { local $/ = '--- Logical extents ---'; while ( my $record = ) { chomp $record; next unless $record =~ /--- Logical volumes ---/; $record =~ s/^.*--- Logical volumes ---\n//s; my ($beginning, $end) = split /--- Distribution of logical volume ---/, $record; my %params = split / +|\n/, $beginning; my @lines = split /\n/, $end; for my $line(@lines) { next if $line =~ /PV Name/; next if $line !~ /\S/; my ($name, $le, $pe) = split ' ', $line; push @{$params{PV}}, {'Name', $name, 'LE on PV', $le, 'PE on PV', $pe}; } push @filesys, \%params; } } print Dumper \@filesys; __DATA__ <---snipp---> --- Logical volumes --- LV Name /dev/vg00/lvol3 VG Name /dev/vg00 LV Permission read/write LV Status available/syncd Mirror copies 1 Consistency Recovery MWC Schedule parallel LV Size (Mbytes) 300 Current LE 75 Allocated PE 150 Stripes 0 Stripe Size (Kbytes) 0 Bad block off Allocation strict/contiguous IO Timeout (Seconds) default --- Distribution of logical volume --- PV Name LE on PV PE on PV /dev/dsk/c3t6d0 75 75 /dev/dsk/c38t6d0 75 75 --- Logical extents --- Some other bogus crap that needs to be ignored. --- Logical volumes --- LV Name /dev/vg00/lvol33 VG Name /dev/vg003 LV Permission read/write LV Status available/syncd Mirror copies 1 Consistency Recovery MWC Schedule parallel LV Size (Mbytes) 500 Current LE 70 Allocated PE 150 Stripes 0 Stripe Size (Kbytes) 0 Bad block off Allocation strict/contiguous IO Timeout (Seconds) default --- Distribution of logical volume --- PV Name LE on PV PE on PV /dev/dsk/c3t6d03 75 75 /dev/dsk/c38t6d03 75 75 --- Logical extents --- <---snip--->