[CrackMonkey] Perl
Mr.Bad
mr.bad at pigdog.org
Sun Jan 14 14:43:33 PST 2001
>>>>> "BB" == Ben Brockert <benb at iastate.edu> writes:
BB> Any bright ideas?
# apt-get install guile
Haha! No, seriously, here's the best I could do:
---8<---
@phrases = ("BAR H", "QUUX", "BAZ BIM");
for $phrase (@phrases) {
$phrase = lc($phrase);
$phrase =~ s/\b(\w)/uc($1)/eg;
print "$phrase\n";
}
---8<---
I think you want to use word-beginning (\b) rather than
string-beginning (^) in your regexp.
~Mr. Bad
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/\____/\ Mr. Bad <mr.bad at pigdog.org>
\ / Pigdog Journal | http://pigdog.org/ | *Stay*Real*Bad*
| (X \x)
( ((**) "If it's not bad, don't do it.
\ <vvv> If it's not crazy, don't say it." - Ben Franklin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the Crackmonkey
mailing list