#!/perl/bin open (In,"tascomod.log") or die ("can not open file at the moment"); open (Out, "tasmodtypfinrpt.txt") or die ("cannot open output file maybe you should create one"); #print Out " TXSpeed Rx Speed"; while ($line=) { @temp = split(/[=]/,$line); #if ($temp[1] >100) # { # print "Session id is $temp[1] with "; # } if ($temp[1]>=1&&($temp[1]<=45)) { $modtyp = $temp[1]; print "\n$modtyp\n"; #the above line prints out ok but does not seem to then print out the statement which corresponds with the value instead #it prints out all the statements, even the ones that do not correspond to the value! if ($modtyp = 20) { print "V34\n"; } if ($modtype = 9) { print "no connection\n"; } elsif ($modtype = 34) { print "V90\n"; } } } #### 9 V34 no connection 34 V34 no connection 9 V34 no connection 45 V34 no connection 45 V34 no connection 7 V34 no connection