The case in point was providing the mean number from numbers, on sepearate lines of a file. Alledgedly, he produced a one-liner 40 characters long, using internal variables.
I enjoy obfuscation to learn more aspects of Perl but disapprove of making Perl code daunting to new coders. I set forth to best 40 characters. This is my attempt:
open I,'o';map{$a+=$_}<I>;print $a/$.
38 characters and yet too readable! Is there a more obscure and brief solution? I have faith that my fellow monks have knowledge to impart.
-- Brother Frankus.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 1: Ars gratia artis.
by tilly (Archbishop) on Oct 04, 2000 at 15:37 UTC | |
|
Latina gratia latinae.
by mdillon (Priest) on Oct 04, 2000 at 19:05 UTC |