Dear All,
The output I want is
"Level A (Grade 1 Reading Level)"
Regards,
Ganesh
N. Ganesh Babu wrote:
Dear All
I want to do capitalisation of this text. I am using the following
code. It works fine with all other lines.
$line="Level A (Grade 1 reading level)";
@words=split(/ /,$line);
for($i=0;$i<=$#words;$i++)
{
$words[$i]=~s!($words[$i])!\u\L$1!gi;
print "$words[$i]\n";
}
This code is showing the following error: The main reason I understood
is the presence of ( and ) in the text.
perl test.pl
Level
A
Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE (Grade)/ at
test.pl line 6.
Compilation exited abnormally with code 255 at Mon Apr 18 15:22:33
Please help me in this regard to solve this problem.
Regards,
Ganesh
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>