[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] TPJ One-Liner #39



Patrik Grip-Jansson wrote;
> perl -e '$/="";$,=" ";print <STDIN>=~/(\b[A-Z]\S*?\b)/g"

Oops, of course it should end with a ' and not a "!

Or why not rewrite it (I blatantly "stole" the idea of using  $" for " "
from Adam Rice's solution);

perl -e'($,,$/)=$";print<>=~/(\b[A-Z]\w*\b)/g'

Shorter, slightly more obfuscated, maybe slightly funnier (and that's what
it's all about, I guess...)  It's still one character longer than Adam's
solution! Darned! :-)


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe