#Block is the chunk of text, word is the 'hidden' word and sep is the number of characters in the text between each word my ($block, $sep, $word)=@_; my @let = split //, $word; my $rep; my $i=1; foreach my $l (@let) {$l = "(".$l.")(.{$sep})";$rep.= '\u$'.$i++.'$'.$i++;}; my $regexp2 = join "", @let; my $ev = '$block =~ '."s/$regexp2/$rep/i;"; # print "Now scanning block with $regexp2 and replacement target $rep\n"; return $block, $word if eval $ev;