use strict; my @file = ; my $word = "color: "; for my $lineno ( 0 .. $#file ) { if ($file[$lineno] =~ /\b$word\b/){ } }