@@ -117,35 +117,21 @@ die if $@;
117
117
*RC_MOVED_TEMPORARILY = \&RC_FOUND; # 302 was renamed in the standard
118
118
push (@EXPORT , " RC_MOVED_TEMPORARILY" );
119
119
120
- *RC_REQUEST_ENTITY_TOO_LARGE = \&RC_PAYLOAD_TOO_LARGE;
121
- push (@EXPORT , " RC_REQUEST_ENTITY_TOO_LARGE" );
122
-
123
- *RC_REQUEST_URI_TOO_LARGE = \&RC_URI_TOO_LONG;
124
- push (@EXPORT , " RC_REQUEST_URI_TOO_LARGE" );
125
-
126
- *RC_REQUEST_RANGE_NOT_SATISFIABLE = \&RC_RANGE_NOT_SATISFIABLE;
127
- push (@EXPORT , " RC_REQUEST_RANGE_NOT_SATISFIABLE" );
128
-
129
- *RC_NO_CODE = \&RC_TOO_EARLY;
130
- push (@EXPORT , " RC_NO_CODE" );
131
-
132
- *RC_UNORDERED_COLLECTION = \&RC_TOO_EARLY;
133
- push (@EXPORT , " RC_UNORDERED_COLLECTION" );
134
-
135
- *HTTP_REQUEST_ENTITY_TOO_LARGE = \&HTTP_PAYLOAD_TOO_LARGE;
136
- push (@EXPORT_OK , " HTTP_REQUEST_ENTITY_TOO_LARGE" );
137
-
138
- *HTTP_REQUEST_URI_TOO_LARGE = \&HTTP_URI_TOO_LONG;
139
- push (@EXPORT_OK , " HTTP_REQUEST_URI_TOO_LARGE" );
140
-
141
- *HTTP_REQUEST_RANGE_NOT_SATISFIABLE = \&HTTP_RANGE_NOT_SATISFIABLE;
142
- push (@EXPORT_OK , " HTTP_REQUEST_RANGE_NOT_SATISFIABLE" );
143
-
144
- *HTTP_NO_CODE = \&HTTP_TOO_EARLY;
145
- push (@EXPORT_OK , " HTTP_NO_CODE" );
120
+ my %compat = (
121
+ REQUEST_ENTITY_TOO_LARGE => \&HTTP_PAYLOAD_TOO_LARGE,
122
+ REQUEST_URI_TOO_LARGE => \&HTTP_URI_TOO_LONG,
123
+ REQUEST_RANGE_NOT_SATISFIABLE => \&HTTP_RANGE_NOT_SATISFIABLE,
124
+ NO_CODE => \&HTTP_TOO_EARLY,
125
+ UNORDERED_COLLECTION => \&HTTP_TOO_EARLY,
126
+ );
146
127
147
- *HTTP_UNORDERED_COLLECTION = \&HTTP_TOO_EARLY;
148
- push (@EXPORT_OK , " HTTP_UNORDERED_COLLECTION" );
128
+ foreach my $name (keys %compat ) {
129
+ push (@EXPORT , " RC_$name " );
130
+ push (@EXPORT_OK , " HTTP_$name " );
131
+ no strict ' refs' ;
132
+ *{" RC_$name " } = $compat {$name };
133
+ *{" HTTP_$name " } = $compat {$name };
134
+ }
149
135
150
136
our %EXPORT_TAGS = (
151
137
constants => [grep /^HTTP_/, @EXPORT_OK ],
0 commit comments