#!/usr/bin/perl # http://perlmonks.org/?node_id=1190261 use strict; use warnings; my $seq_txt_file = < length $a } map s/^\s+|\s+$//gr, split /\n/, $seq_txt_file; my $regex = do { local $" = '|'; qr/(@seqs)/i }; print s/$regex/ $1 =~ s!\h+!bbb!gr /ger while ; __DATA__ Many of them are scooped up by chambermaids, thrown into bin bags and sent off to landfill sites, which is a disaster for the environment and a social travesty given that many people around the world are going without proper sanitation. Another test with capitals, a Social Travesty if I've ever seen one without Proper Sanitation.