|Perl: the Markov chain saw|
Re: P2P Golf: MoleSterby bgreenlee (Friar)
|on Dec 16, 2004 at 16:30 UTC||Need Help??|
I missed this post yesterday, as I was deep into writing my own perl P2P app, after someone posted the challenge to the Fun With Perl mailing list. Mine is slightly bigger (717 characters, including newlines), but still 9 lines. I worked under the assumption that any modules in the standard perl distro were fair game (hence IO::Socket)
I tried to emulate the operation of the original python version as closely as possible. I did add one feature that i thought was essential, though: the ability to view files on the network without actually downloading them.
I'm sure better golfers than I could knock this down a bit.
Anyway, mine is used like so:
Note that when entering a pattern, you need to escape the backslash. So to search for .mp3 files, the pattern would be \\.mp3$