in reply to Changing the first word to uppercase
You need to capture just the first word and replace it with uc $1. To make that work use the /e qualifier to the substitution which evaluates the replace ment as perl code.
my $words ='one two three'; $words =~ s/^([[:alpha:]]+)/ uc $1 /e; print $words; __END__ ONE two three
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Changing the first word to uppercase
by Anonymous Monk on Feb 14, 2008 at 00:38 UTC | |
by graff (Chancellor) on Feb 14, 2008 at 02:07 UTC | |
by hipowls (Curate) on Feb 14, 2008 at 02:13 UTC | |
by jrtayloriv (Pilgrim) on Feb 14, 2008 at 00:49 UTC | |
by Anonymous Monk on Feb 14, 2008 at 01:01 UTC | |
by Anonymous Monk on Feb 14, 2008 at 07:57 UTC |