Bencode reviews

RSS | Module Info

Bencode (1.0)

Some notes on this module from me as the author:

Originally I had no plans to release this code. I just wanted a script to read .torrent files, which I tried to write using Convert::Bencode and Convert::Bencode_XS. Neither of them worked on any of the files I tried to read. So I ended up rolling my own, and while I only intended to implement the minimum I needed, I found that the bencode format is so simple that writing a partial implementation is not even possible.

So now there was one working bencode implementation in my script, and none on CPAN. Why not upload the code? And that’s what I did. I poached the unit tests from the original, made them all pass, and then wrapped it into a package and dropped it in CPAN’s lap.

The other issue concerns the name. I had pondered which namespace to place this module in. The Convert:: namespace seemed ill-thoughout. Bencode is a data structure serialisation format. Historically, serialisers in Perl are generally in the toplevel namespace: Storable, FreezeThaw, YAML. So I opted for the same route. I did consider Data::Bencode (along the lines of Data::Dumper) and may yet rename the module.

But that’s that for now.

Share and enjoy.