#!/usr/bin/perl -w ################################ use strict; open(PIPE,'netstat -i|') or die $!; my $header=; # Kernel Interface Table $header=; # The real header chomp $header; # # Oh... what the hey... Let's parse it just for grins. my @fields=split(/[\s]+/,$header); my %ifTable=(); # Set up an empty assoc array while (my $line=){ chomp $line; my @f=split(/[\s]+/,$line); foreach my $ix(1..$#f){ $ifTable{$f[0]}->{$fields[$ix]}=$f[$ix]; } } # # But wait... you just wanted the IF names: printf "%s\n",join(",",keys %ifTable);