open( FILE, "file" ) || die ("The file not there "); #open the file with 50,000 lines (some 1MB memory) @list=; # put this in an array. close(DICTIONARY); # close the file $regex="somebla.."; #this is the regex to be matched @match=grep(/$regex/,@list); #the above line returns an array of all lines matched # but I want only first one !! Pity don't know how to # get only that.. print $match[0]; #so I get the first match of the retrned array.. #that is poor .grep has to go through the complet list # although I need the first match only