[plug] Find similarly named files in directories (golf match)

Bernard Blackham bernard at blackham.com.au
Sat Jan 13 12:28:06 WST 2007


Bernard Blackham wrote:
>> Was a challenge for golf originally an i'm bored. 138 chars is benchmark.
> 
> Gah, I'll bite. 59 chars of perl, 74 chars altogether.
> 
> find|perl -ne'm#.*(/.*)#;push@{$a{$1}},$_}foreach(%a){$#$_>0&&print"@$_\n"'

Subtract 4 bytes: s/each//

Thus 55 chars of perl, 70 chars altogether.

Bernard.



More information about the plug mailing list