For a newbie, this is what I came up with, but I think there is probably a more elegant solution.
@netifdata_array = ( Time|Interface | Network| In| Out|,
Stamp|Name | Speed| KB Rate| KB Rate|);
my (@line1, @line2, @line3);
my $ct;
@line1 = split(/\s*\|\s*/, @netifdata_array[0]);
@line1 = grep(s/\s*//g, @line1);
@line2 = split(/\s*\|\s*/, @netifdata_array[1]);
@line2 = grep(s/\s*//g, @line2);
$ct = $ct + scalar(@line2);
for (my $i = 0; $i < $ct; $i++)
{
push (@line3, $line1[$i], $line2[$i], "|");
}
print @line3,"\n";
вывод: TimeStamp | InterfaceName | NetworkSpeed | InKBRate | OutKBRate |