in reply to Re^2: Changing the first word to uppercase
in thread Changing the first word to uppercase
I accidentally used lc where I should have used uc, but you shouldn't get the behaviour you describe either way.
>type infile hello h e l l o bye b y e bike b i k e >perl -pe"s/(.)/uc($1)/e" infile > outfile >type outfile Hello h e l l o Bye b y e Bike b i k e
or
>type infile hello h e l l o bye b y e bike b i k e >type script.pl while (<>) { s/(.)/uc($1)/e; print; } >perl script.pl infile > outfile >type outfile Hello h e l l o Bye b y e Bike b i k e
You must be doing something extra.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Changing the first word to uppercase
by Anonymous Monk on Feb 14, 2008 at 00:58 UTC |