Perhaps your code will run better like this:
#!/usr/bin/perl
#network_coco.plx
use warnings;
use strict;
open DATAOUT2, '>>', 'cococount.txt' or die "$!\n";
for my $count ( 90 .. 95 ) {
open DATAIN, '<', $ARGV[ 0 ] or die "cannot open \"ARGV[0]\":$!";
open DATAOUT, '>', 'variable' or die "$!\n";
while ( <DATAIN> ) {
my $field = ( split /\t/ )[ 2 ];
if ( $field >= "0.$count" ) {
print DATAOUT;
}
}
close DATAOUT;
close DATAIN;
#clm close reads file variable, and gives back an integer
open VAR2, '-|, 'clm', 'close', '-abc', 'variable', '--is-undirect
+ed', '--write-count', '-cc-bound', '5' or die "$!\n";
while ( <VAR2> ) {
chomp;
print DATAOUT2 "0.$count\t$_\n";
}
close VAR2 or warn $! ? "Error closing pipe: $!"
: "Exit status $? from clm";
}
close DATAOUT2;