#!/usr/bin/perl -w my @sentence_list = ( 'radiohead', 'turn off your radio', 'jill has a radio that is black', 'the stereo is broken', 'radio for happiness', ); foreach $sentence (@sentence_list){ if ($sentence =~ /(^|\W)radio(\W|$)/){ print "Found\n"; } else { print "Not found\n"; } }