in reply to Re: Golf: Improve this guy's fail . . . please!
in thread Golf: Improve this guy's fail . . . please!
At the opposite end of the spectrum, reading in the whole file:
local $/; ++$chars{$_} for <> =~ /\w/g
(Trimmed: local$/;++$c{$_}for<>=~/\w/g)
It only accepts one file, though.
Update: 5 shorter, accepts multiple files, and doesn't mess with $/:
++$chars{$_} for map /\w/g, <>
(Trimmed: ++$c{$_}for map/\w/g,<>)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Golf: Improve this guy's fail . . . please!
by mr_mischief (Monsignor) on Jul 01, 2009 at 00:38 UTC | |
by shmem (Chancellor) on Jul 01, 2009 at 00:43 UTC | |
by mr_mischief (Monsignor) on Jul 01, 2009 at 01:24 UTC |