Change case

Here is a little perl script that you can use to lowercase text with an uppercase first letter of each word. If you put it in your BBEdit unix filters it will work on any selected text.

#! perl -w
use strict;

while (<>) {
tr/[A-Z]/[a-z]/;
s/\b([a-z])/\u$1/g;
print $_;
}

One Response to “Change case”

  1. Chevinboy Says:

    Nice code - Shame it doesn’t work
    Second line should be:
    s/\b([a-z])/\u$1/g;