#!/usr/bin/perl use strict; use warnings; my $PolicyName = ""; my $PolicyType = ""; my $ActivePolicy = ""; my $ClientServer = ""; open(INFILE, ') { if ($_ =~ "Policy Name") { $PolicyName = $_; #print $line; } if ($_ =~ "Policy Type") { $PolicyType = $_; } if (($_ =~ "Active") && ($_ =~ "yes")) { $ActivePolicy = $_; print $PolicyName; print $PolicyType; print $ActivePolicy; } if ($_ =~ "HW/OS/Client") { while ($_) { next if /^$/; $ClientServer = $_; print $ClientServer; next; } } next; }