aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobbie-hatley <Robbie.Hatley@gmail.com>2025-07-17 19:28:28 -0700
committerrobbie-hatley <Robbie.Hatley@gmail.com>2025-07-17 19:28:28 -0700
commit395b28bb892e96abc8d8fd41e312ad1ddd977c07 (patch)
tree3d317a963db6f6afe3f439c5cc2e0a2d6c9aaa8f
parent7c1624fe6e96891d4b61e728df77e24a60974039 (diff)
downloadperlweeklychallenge-club-395b28bb892e96abc8d8fd41e312ad1ddd977c07.tar.gz
perlweeklychallenge-club-395b28bb892e96abc8d8fd41e312ad1ddd977c07.tar.bz2
perlweeklychallenge-club-395b28bb892e96abc8d8fd41e312ad1ddd977c07.zip
Now using "ucfirst" to Title-Case first characters.
-rwxr-xr-xchallenge-330/robbie-hatley/perl/ch-2.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-330/robbie-hatley/perl/ch-2.pl b/challenge-330/robbie-hatley/perl/ch-2.pl
index 8c5428f9f0..e551ab01c0 100755
--- a/challenge-330/robbie-hatley/perl/ch-2.pl
+++ b/challenge-330/robbie-hatley/perl/ch-2.pl
@@ -59,7 +59,7 @@ Output is to STDOUT and will be each input followed by the corresponding output.
my $n = scalar(@words);
for ( my $idx = 0 ; $idx < $n ; ++$idx ) {
if ( 0 == $idx || $n-1 == $idx || length($words[$idx]) >= 3 ) {
- $words[$idx] =~ s/^(.)(.*)$/uc($1).lc($2)/e}
+ $words[$idx] =~ s/^(.)(.*)$/ucfirst($1).lc($2)/e}
else {
$words[$idx] = lc $words[$idx]}}
return join ' ', @words}