while (my $line = <$in_fh>>) { if ($line =~ /([.(]?abc)/){ print "Hello $1\n"; }