#!/usr/bin/env perl use warnings; use strict; my $toFind = 'String'; while () { print if /\b$toFind\s/i; } __DATA__ this is a string strings are us String.c is a file so string.o is too I like a good STRING now and again #### this is a string I like a good STRING now and again