#!/usr/bin/perl #network_coco.plx use warnings; use strict; open(DATAIN, "<$ARGV[0]")||die"cannot open \"ARGV[0]\":$!"; open(DATAOUT2, ">>cococount.txt")||die"$!\n"; for(my $count=0.9; $count<=0.95; $count=$count+0.01) { open(DATAOUT, ">variable")||die"$!\n"; while() { my @line=split (/\t/); if($line[2] >= $count) { print DATAOUT; } } close(DATAOUT); system ("clm close -abc variable --is-undirected --write-count -cc-bound 5 > var2"); #clm close reads file variable, and gives back an integer open(VAR2, ") { chomp; print DATAOUT2 "$count\t$_\n"; } close(VAR2); } close(DATAOUT2); #### 0.9 (tab) 13 0.91 (tab) 9 0.92 (tab) 7 0.93 (tab) 8 0.94 (tab) 5 0.95 (tab) 4 And what I get is: 0.9 (tab) 13 0.91 (tab) 0 0.92 (tab) 0 0.93 (tab) 0 0.94 (tab) 0