#!/usr/bin/env perl # use strict; use warnings; open F, ") { /^system\d+-server$/ and do {$system= $_; next}; /^HW a2b.*\(.*\)$/ and $box{$system}= $_; s/^\s*(\d+) packets input.*$/$1/ and $bin{$system}= $_; s/^\s*(\d+) packets output.*$/$1/ and $bout{$system}= $_; s/^Description: (.*)$/$1/ and $desc{$system}= $_; } foreach (keys %desc) { print "System: ". $_; print "Box: ". $box{$_}; print "ByteIn: ". $bin{$_}; print "Byteout: ". $bout{$_}; print "Description: ". $desc{$_}; }