use File::Basename; my $filename=fileparse($ARGV[0]); $win=1000; # window size 1kb $L=`/scratch/xli91_lab/bin/rpyc/sumcol $ARGV[2] 2`; # total nt of genome excluding chrUext and chrM $N=$L/$win; $ratio=$ARGV[1]*0.01; open IN,$ARGV[2]; while() #there was no $_[1]; it was undef/blank. After explicitly declaring/storing in @array, it worked { chomp; split(/\t/); $chrsize{$_[0]}=int($_[1]/$win); }