#!/usr/bin/perl open SEE ,"c:/abc.txt"; @ok=; close(SEE); foreach(@ok) { if($_ =~ /HATL/) { ($o,$t) = split(/\s+/, $_); print "second value $t
"; ### I would like to catch email address values before HATL or SALTL line starts... ### How can i do that? } if($_ =~ /SALTL/) { ($o,$t) = split(/\s+/, $_); print "second value $t
"; } }