Help for this page

Select Code to Download


  1. or download this
    my $str = "foo bar baz quux";
       $str =~ s<([a-z]+)
                 (?{ s| \1|\L$&|; })><\U$1>xg;
    
  2. or download this
    $str =~ s<([a-z]+ ?)><local $_ = $1; s/$1/\U$&/g; $_>eg;