#!/usr/local/bin/perl # Selects lines from file1 depending on sign of elements in file2 $n = "hm/h4d" ; $h = "dat/HBB.list" ; $c = 3 ; # How to override min and max values with command line eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; $c--; open ( H , "<$h" ) ; open ( N , "<$n" ) ; while( ( $_ = ) && ( $d = ) ) { $d =~ s/^\s*//; @f = split(' ',$d) ; # print $f[$c] , "\n" ; if ( $f[$c] < 0.0 ) { print $_ ; } }