while (<>) { ($null,$x,$y,$z,$xb,$yb,$zb,$tp,$f1,$f2) = split m!\+|\-|\s\+|\s\-|\s!; if ($f2 == undef){next;} #skip incomplete line elsif (($x<10) && ($y<10) && ($z<10)){ $axis[0] = "b";} # Bias elsif ($x>30){ $axis[1] = "x";} # X elsif ($y>30){ $axis[2] = "y";} # Y elsif ($z>30){ $axis[3] = "z";} # Z # Temperature if (($tp<45) && ($tp>35)){$temp[0] = 40; $output[@axis][@temp] .= $_;} #-40 elsif (($tp<25) && ($tp>15)){$temp[1] = 20; $output[@axis][@temp] .= $_;} #+20 elsif (($tp<85) && ($tp>75)){$temp[2] = 80; $output[@axis][@temp] .= $_;} #+80 } @file = qw(bias.txt x.txt y.txt z.txt); foreach $filename (@file) { open $fh, '>', $filename; foreach $temp (@{$output[$temp]}) { print $fh $output[$temp][$axis], "\n"; } $axis++; }