in reply to Opening file and checking for data
my $count = grep /match/, <DATA>; print $count; __DATA__ match123123 match3123 nomat not34234 match 4232434 [download]
print scalar(grep /match/, <DATA>); [download]