On Tuesday, Jul 22, 2003, at 20:10 US/Pacific, Wiggins d'Anconia wrote:
Octavian Rasnita wrote:
[..]
Of course, he was talking about CGI programming, because I know that
Perl
can do much more than CGI programming like PHP.
As much as we jest at your expense I suppose a real answer should
be
Sara,
You can use ucfirst.
$TS =~ s/(\w+)/ucfirst lc $1/ge;
Scott
-Original Message-
From: Sara [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 12:59 PM
To: org
Subject: Another Regex question.
$TS = THIS INPUT IS IN ALL CAPS;
$TS_cont = lc $TS;
$TS now prints out this
#!/usr/bin/perl -w
my $TS = THIS INPUT IS IN ALL CAPS;
my $lc_ts = lc($TS);
my @words = split(/\s+/, $lc_ts);
my @letters = ();
foreach my $word(@words) {
chomp($word);
if($word =~ /^(\w{1})(\w*)/) {
print uc($1) . $2 . ;
}
else {
die Something is seriously wrong here...;
}
}
#
On Wed, 23 Jul 2003 21:58:52 +0500, Sara [EMAIL PROTECTED] wrote:
$TS = THIS INPUT IS IN ALL CAPS;
$TS_cont = lc $TS;
$TS now prints out this input is in all caps
What If I want first letter in caps for every word in string? which should