# to figure out if a line matches write: if ($endUnixLine =~ /^otsort.*/) { print 'matches'; }