if ( $msgtype eq "18FEF200"){ $bytes34 = substr $line, 26, 2; print "Line is: $line\n"; print "qty is: $bytes34\n"; }