in reply to Tricky File Parsing

Showing code is a good idea but as I was bored at the time this should get you started:

use Data::Dumper; # get you datafile into a scalar variable (sample put in __DATA__) my $data = join '', <DATA>; my $split_pat = qr/-{28}\n([\w\d\.-]+)\n-{28}\n*/; my @data = split /$split_pat/, $data; shift @data; %servers = @data; for my $server (keys %servers) { my %progs = split /\n{2,}/, $servers{$server}; $servers{$server} = \%progs; for my $prog ( keys %{$servers{$server}} ) { my @data = split /\n+/, $servers{$server}->{$prog}; $servers{$server}->{$prog} = \@data; } } print Dumper \%servers; __DATA__ Dumper output: $VAR1 = { 'Server1.dom.com' => { 'WINDOWS 2000 SERVER SP2' => [ 'WARNI +NG MS01-022 Q296441', 'Patch + NOT Found MS02-001 Q311401', 'Patch + NOT Found MS02-006 Q314147', 'Patch + NOT Found MS02-012 Q313450', 'Patch + NOT Found MS02-013 Q300845', 'Patch + NOT Found MS02-014 Q313829' ], 'Internet Information Services 5.0' = +> [ + 'Patch NOT Found MS02-001 Q311401', + 'Patch NOT Found MS02-012 Q313450' + ], 'Internet Explorer 5.5 SP2' => [ 'Pat +ch NOT Found MS02-005 Q316059', 'Pat +ch NOT Found MS02-009 Q318089' ] }, 'Server2.dom.com' => { 'WINDOWS 2000 SERVER SP2' => [ 'WARNI +NG MS01-022 Q296441', 'Patch + NOT Found MS02-001 Q311401', 'Patch + NOT Found MS02-006 Q314147', 'Patch + NOT Found MS02-013 Q300845', 'Patch + NOT Found MS02-014 Q313829' ], 'Internet Explorer 5.5 SP1' => [ 'Pat +ch NOT Found MS02-005 Q316059', 'Pat +ch NOT Found MS02-009 Q318089' ] } };

Effort in reply is proportional to effort exerted by seeker of wisdom.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print