for (@list){ ### This will not match 'String' at the end of the line print if /String\s/; } #### for (@list){ print if /String\b/; }