Permalink
Browse files

Support Perl older than <5.10 (// operator). Release 0.003.

  • Loading branch information...
1 parent 6330204 commit 4eb40e8de78df9c178cf9ff61285eb1c3839492e @wolfsage committed Jan 8, 2013
Showing with 13 additions and 3 deletions.
  1. +6 −0 Changes
  2. +1 −1 dist.ini
  3. +6 −2 lib/Net/RNDC/Packet.pm
View
@@ -1,5 +1,11 @@
{{$NEXT}}
+0.003 Tue, Jan 08, 2013
+
+ [BUG FIXES]
+
+ * Replace defined-or to work with older Perls (<5.10)
+
0.002 Fri, Jan 04, 2013
[BUG FIXES]
View
@@ -4,7 +4,7 @@ license = Perl_5
copyright_holder = Matthew Horsfall
copyright_year = 2012
-version = 0.002
+version = 0.003
; Damn, requires Perl 5.10
; [Git::Check]
@@ -238,9 +238,13 @@ sub _binary_fromwire {
sub _binary_towire {
my ($data) = @_;
+ if (!defined $data) {
+ $data = 'null';
+ }
+
return pack('c', ISCCC_CCMSGTYPE_BINARYDATA)
- . pack('N', length($data // 'null'))
- . ($data // 'null');
+ . pack('N', length($data))
+ . ($data);
}
# Take a table from binary format and return a hashref

0 comments on commit 4eb40e8

Please sign in to comment.