On topic: The Wednesday Challenge

Aaron Crane perl at aaroncrane.co.uk
Wed Aug 15 15:54:16 BST 2007


Robin Barker writes:
> Does this work? I've never used $/ = \number.
> 
> $/ = \1;
> @bytes = (0) x 256;
> while( <> ) { $bytes[ord]++ }
> for (0..255) { print chr x $bytes[$_] }

Nor me, but apparently it does.  Therefore:

  perl -e'$/=\1;print sort<>'

-- 
Aaron Crane


More information about the london.pm mailing list