@a = qw( food foot ); foreach (@a) { s/foo/bar/g } # @a is now qw( bard bart )