Subject: | Net::IPP doesn't work on a modern perl |
Modern 'constant' does not put a sub into the hash table. See the TECHINCAL NOTE in `perldoc constant` for more details. The included patch will build @EXPORT_OK by hand for those constants.
The patch also includes 0x13 NO_VALUE type.
Subject: | Philip_Gwyn-Net_IPP-constants-01.patch |
Only in Net-IPP-0.1-PG: MYMETA.json
Only in Net-IPP-0.1-PG: MYMETA.yml
Only in Net-IPP-0.1-PG: Makefile
Only in Net-IPP-0.1-PG: blib
diff -rub Net-IPP-0.1-ORIG/lib/Net/IPP/IPP.pm Net-IPP-0.1-PG/lib/Net/IPP/IPP.pm
--- Net-IPP-0.1-ORIG/lib/Net/IPP/IPP.pm 2004-11-11 08:05:21.000000000 -0500
+++ Net-IPP-0.1-PG/lib/Net/IPP/IPP.pm 2016-06-17 15:15:56.420131553 -0400
@@ -42,6 +42,7 @@
# print debug messages
use constant DEBUG => 0;
+push @EXPORT_OK, qw( DEBUG );
# constants used in IPP request hash as keys
# (let no IPP attribute collide with these names)
@@ -57,15 +58,21 @@
use constant HP_BUGFIX => "__hp-bugfix__";
use constant HTTP_CODE => "__http-code__";
use constant HTTP_MESSAGE => "__http-message__";
+push @EXPORT_OK, qw( URL OPERATION STATUS REQUEST_ID GROUPS TYPE VALUE DATA VERSION HP_BUGFIX HTTP_CODE HTTP_MESSAGE );
+
# IPP Version
use constant IPP_MAJOR_VERSION => 1;
use constant IPP_MINOR_VERSION => 1;
+push @EXPORT_OK, qw( IPP_MAJOR_VERSION IPP_MINOR_VERSION );
+
+
# IPP Types
our %type;
registerConstants(\%type, {
+ NO_VALUE => 0x13,
DELETE_ATTRIBUTE => 0x16,
INTEGER => 0x21,
BOOLEAN => 0x22,
Only in Net-IPP-0.1-PG/lib/Net/IPP: IPP.pm~
diff -rub Net-IPP-0.1-ORIG/lib/Net/IPP/IPPAttribute.pm Net-IPP-0.1-PG/lib/Net/IPP/IPPAttribute.pm
--- Net-IPP-0.1-ORIG/lib/Net/IPP/IPPAttribute.pm 2004-11-11 07:56:23.000000000 -0500
+++ Net-IPP-0.1-PG/lib/Net/IPP/IPPAttribute.pm 2016-06-17 15:17:08.044180847 -0400
@@ -298,6 +298,8 @@
} elsif ($type == &END_COLLECTION
|| $type == &MEMBER_ATTR_NAME) {
return $value;
+ } elsif ( $type == &NO_VALUE ) {
+ return $value;
} else {
carp "Unknown Value type ", sprintf("%#lx",$type) , " for key \"$key\". Performing no transformation.";
return $value;
Only in Net-IPP-0.1-PG/lib/Net/IPP: IPPAttribute.pm~
Only in Net-IPP-0.1-PG: pm_to_blib