http://qs1969.pair.com?node_id=476850


in reply to String replacement

Probably not the best way to do it, but this works:
my $a = "ABABA"; my $b = "BB--B-BB"; $b =~ s/B/\%c/g; printf $b, unpack 'c*', $a;
Gets rid of the loop, at least *grin*.