line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Business::US::USPS::IMB; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
28659
|
use 5.010001; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2240
|
|
|
1
|
|
|
|
|
289
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
12
|
|
|
|
|
|
|
usps4cb |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = qw( |
16
|
|
|
|
|
|
|
encode_IMB |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
require XSLoader; |
22
|
|
|
|
|
|
|
XSLoader::load('Business::US::USPS::IMB', $VERSION); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Preloaded methods |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub encode_IMB { |
28
|
1
|
|
|
1
|
1
|
2120
|
my $track_num = pack("Z21", shift); |
29
|
1
|
|
|
|
|
5
|
my $route_num = pack("Z12", shift); |
30
|
1
|
|
|
|
|
3
|
my $bar_string = pack("Z66",""); |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
15
|
my $result_code = Business::US::USPS::IMB::usps4cb($track_num,$route_num,$bar_string); |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
6
|
return unpack("Z66",$bar_string), $result_code; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |