in reply to Searching for and removing multi-line file entries
Then you can find the ones that are "serverX" records, something like: my @server_records = grep { $_->{'[]'} =~ /^server/ } @records; What else did you need to do, after this?my @records; $/ = "\n["; while (<>) { chomp; my( $h, @l ) = split /\n/; $h =~ s/^\[//; $h =~ s/\]$//; push @records, { '[]' => $h, map { split /\s*=\s*/, $_, 2 } @l }; }
jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.
|
|---|