Tuesday, April 8, 2008

Real Cool Perl

A friend on mine posted this Perl tidbit in IRC, so I had to pass it along:

(9:23:00 AM) ghost: $name =~ s/([\W\-])?([^\s\-]+)/join('', $1||'', ucfirst(lc($2)))/ge
(9:25:02 AM) ghost: that takes a sentence in all caps.. "SUCH AS THIS" and turns it into "Such As This"

NICE... for sure.

0 Comments:

Post a Comment

<< Home