Protocol::BitTorrent::Bencode - mixin for bencode/bdecode support
version 0.003
package Some::Package; use parent qw(Protocol::BitTorrent::Bencode); sub new { bless {}, shift } sub method { my $self = shift; $self->bencode({ data => ... }); }
A simple mixin that provides "bencode" and "bdecode" methods for use in other classes. The intention is to allow different bencode implementations by changing a single class.
Decode the given data. May die() if the given bytestring is not valid bencoded data.
Encode the given data. May die() if the given Perl data structure contains any undefined values.
Tom Molesworth <cpan@entitymodel.com>
Copyright Tom Molesworth 2011. Licensed under the same terms as Perl itself.
To install Protocol::BitTorrent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::BitTorrent
CPAN shell
perl -MCPAN -e shell install Protocol::BitTorrent
For more information on module installation, please visit the detailed CPAN module installation guide.