Lower-Case Golf (Was: Programming Contest)

smylers at stripey.com smylers at stripey.com
Fri Feb 8 09:58:45 CST 2002


I wrote:

>   perl -pe'$_="\U$_"'  # 10

Ooops.  Typo there, since that's blatantly nineteen rather than ten.

If using \U isn't in the spirit of things, this is the shortest I've got
otherwise:

  perl -naF// -e'print map$_&64?chr$_-32:chr,map{ord}@F'  # 54

Smylers



More information about the Belfast-pm mailing list