CamelCase in Perl
Example for versions
perl 5.12.1,
perl 5.8.8
This is similar to the previous example, except that instead of splitting on non-alphabetical characters, we match on runs of alphabetical characters.
my $text = <STDIN>;
$text = join('', map(ucfirst, lc($text) =~ /[a-z]+/g));
print "$text\n";
Comments
]]>blog comments powered by Disqus
]]>