in reply to help with an array
use strict; open (MYFILE,"<testing.txt")||die "Could not open input file\n"; my @datas = grep /^Hello\s+/, <MYFILE>; my $countline = $#datas + 1; # or just treat $#datas as linecount-1 [download]
One world, one people