On topic: The Wednesday Challenge

Peter Corlett abuse at cabal.org.uk
Wed Aug 15 17:20:43 BST 2007


On 15 Aug 2007, at 15:01, Andy Armstrong wrote:
> Given a 64 Mbyte file containing random binary data write a perl  
> program such that
> $ perl myprog.pl < 64m.bin > 64m.sorted.bin
> outputs a file 64m.sorted.bin with all the bytes sorted in  
> ascending order. Marks will be given for speed, brevity and  
> parsimonious use of memory.

#!/usr/bin/perl -C0 -anF//
++$_[ord]for at F}{print chr()x$_[$_]for(0..$#_)




More information about the london.pm mailing list