#!c:\perl\bin\perl -w open(NB, "nbt.csv")|| die"Cant open input file nbt.csv"; # NBT.CSV simply contains ip addresses - one per line while() {undef $line; chomp $_; $line="$_".","; @nbtstat = `nbtstat -a $_`; $len=@nbtstat; for ($j=0; $j<$len;$j++) {$short=substr($nbtstat[$j],0,15); chomp $short; unless ($line=~m/$short/) {$line=$line.",".$short;} } print "$line\n"; } close(NB);