$_ = 'pqrstuvw'; my $i = 3; while($i) { $i--; s/\w/B/; } print "$_\n"; __END__ Bqrstuvw