Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ready for PAUSE. Look out, World!

  • Loading branch information...
commit ad0b7b5a744730f19490fcba81c94c974a8ce65d 1 parent f612e4d
@sanko authored
View
6 Build.PL
@@ -16,12 +16,14 @@ my $mb = Module::Build->new(
requires => {
Exporter => 0,
'Module::Build' => 0.38,
- perl => '5.10.0'
+ perl => '5.10.0',
+ Carp => 0
},
build_requires => {Exporter => 0,
'Module::Build' => 0.38,
perl => '5.10.0',
- 'Test::More' => 0
+ 'Test::More' => 0,
+ Carp => 0
},
configure_requires => {'Module::Build' => 0.38, 'File::Find' => 0},
auto_features => {
View
8 lib/Net/BitTorrent/Protocol.pm
@@ -1,5 +1,5 @@
package Net::BitTorrent::Protocol;
-#use strict;
+use strict;
use warnings;
our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[\S] ? '-%s' : ''), $MAJOR, $MINOR, $PATCH, $DEV);
use lib '../../../lib';
@@ -22,9 +22,9 @@ use Exporter qw[];
},
],
compact => [@{$Net::BitTorrent::Protocol::BEP07::EXPORT_TAGS{all}},
- @{$Net::BitTorrent::Protocol::BEP23::EXPORT_TAGS{all}}],
- parse => [
- @{$Net::BitTorrent::Protocol::BEP03::EXPORT_TAGS{parse}},
+ @{$Net::BitTorrent::Protocol::BEP23::EXPORT_TAGS{all}}
+ ],
+ parse => [@{$Net::BitTorrent::Protocol::BEP03::EXPORT_TAGS{parse}},
@{$Net::BitTorrent::Protocol::BEP06::EXPORT_TAGS{parse}},
@{$Net::BitTorrent::Protocol::BEP10::EXPORT_TAGS{parse}},
qw[parse_packet]
View
17 lib/Net/BitTorrent/Protocol/BEP03.pm
@@ -1,9 +1,8 @@
package Net::BitTorrent::Protocol::BEP03;
-our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[S]? '-%s' : '') , $MAJOR, $MINOR, $PATCH, $DEV);
-
+our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[S] ? '-%s' : ''), $MAJOR, $MINOR, $PATCH, $DEV);
use Carp qw[carp];
use lib '../../../../lib';
- use vars qw[@EXPORT_OK %EXPORT_TAGS];
+use vars qw[@EXPORT_OK %EXPORT_TAGS];
use Exporter qw[];
*import = *import = *Exporter::import;
%EXPORT_TAGS = (
@@ -189,7 +188,7 @@ sub parse_unchoke ($) { return; }
sub parse_interested ($) { return; }
sub parse_not_interested ($) { return; }
-sub parse_have ($) {
+sub parse_have ($) {
my ($packet) = @_;
if ((!$packet) || (length($packet) < 1)) {
carp 'Incorrect packet length for HAVE';
@@ -198,7 +197,7 @@ sub parse_have ($) {
return unpack('N', $packet);
}
-sub parse_bitfield ($) {
+sub parse_bitfield ($) {
my ($packet) = @_;
if ((!$packet) || (length($packet) < 1)) {
carp 'Incorrect packet length for BITFIELD';
@@ -207,7 +206,7 @@ sub parse_bitfield ($) {
return (pack 'b*', unpack 'B*', $packet);
}
-sub parse_request ($) {
+sub parse_request ($) {
my ($packet) = @_;
if ((!$packet) || (length($packet) < 9)) {
carp sprintf('Incorrect packet length for REQUEST (%d requires >=9)',
@@ -217,7 +216,7 @@ sub parse_request ($) {
return ([unpack('N3', $packet)]);
}
-sub parse_piece ($) {
+sub parse_piece ($) {
my ($packet) = @_;
if ((!$packet) || (length($packet) < 9)) {
carp sprintf('Incorrect packet length for PIECE (%d requires >=9)',
@@ -227,7 +226,7 @@ sub parse_piece ($) {
return ([unpack('N2a*', $packet)]);
}
-sub parse_cancel ($) {
+sub parse_cancel ($) {
my ($packet) = @_;
if ((!$packet) || (length($packet) < 9)) {
carp sprintf('Incorrect packet length for CANCEL (%d requires >=9)',
@@ -237,7 +236,7 @@ sub parse_cancel ($) {
return ([unpack('N3', $packet)]);
}
-sub parse_port ($) {
+sub parse_port ($) {
my ($packet) = @_;
if ((!$packet) || (length($packet) < 1)) {
carp 'Incorrect packet length for PORT';
View
3  lib/Net/BitTorrent/Protocol/BEP06.pm
@@ -1,6 +1,5 @@
package Net::BitTorrent::Protocol::BEP06;
-our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[S]? '-%s' : '') , $MAJOR, $MINOR, $PATCH, $DEV);
-
+our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[S] ? '-%s' : ''), $MAJOR, $MINOR, $PATCH, $DEV);
use Carp qw[carp];
use vars qw[@EXPORT_OK %EXPORT_TAGS];
use Exporter qw[];
View
2  lib/Net/BitTorrent/Protocol/BEP10.pm
@@ -1,5 +1,5 @@
package Net::BitTorrent::Protocol::BEP10;
-our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[S]? '-%s' : '') , $MAJOR, $MINOR, $PATCH, $DEV);
+our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[S] ? '-%s' : ''), $MAJOR, $MINOR, $PATCH, $DEV);
use Carp qw[carp];
use lib '../../../../lib';
use Net::BitTorrent::Protocol::BEP03::Bencode qw[:all];
View
2  lib/Net/BitTorrent/Protocol/BEP23.pm
@@ -2,7 +2,7 @@ package Net::BitTorrent::Protocol::BEP23;
use strict;
use warnings;
use Carp qw[carp];
-our $MAJOR = 0; our $MINOR = 74; our $DEV = 14; our $VERSION = sprintf('%0d.%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
+our $MAJOR = 0; our $MINOR = 1; our $PATCH = 0; our $DEV = 'rc5'; our $VERSION = sprintf('%0d.%0d.%0d' . ($DEV =~ m[S] ? '-%s' : ''), $MAJOR, $MINOR, $PATCH, $DEV);
use vars qw[@EXPORT_OK %EXPORT_TAGS];
use Exporter qw[];
*import = *import = *Exporter::import;
View
4 t/0003_net_bittorrent_protocol_bep03_bencode.t
@@ -15,7 +15,7 @@ BEGIN {
# Does it return 1?
use_ok 'Net::BitTorrent::Protocol::BEP03::Bencode', ':all';
-#integer
+# integer
is bencode(4), 'i4e', 'integer';
is bencode(0), 'i0e', 'zero';
is bencode(-0), 'i0e', 'zero w/ sign';
@@ -29,7 +29,7 @@ is bencode(-3), 'i-3e', q[bencode -3];
is bencode('-0'), '2:-0',
q[bencode '-0' returns valid string-type (is this okay?)];
-#string
+# string
is bencode('Perl'), '4:Perl', 'string';
is bencode(''), '0:', 'null string';
is bencode(undef), undef, 'undef';
Please sign in to comment.
Something went wrong with that request. Please try again.