Subject: | PDF::API2::Resource::XObject::Form::BarCode::int2of5 broken |
In PDF::API2::Resource::XObject::Form::BarCode::int2of5, the 'new' sub calls sub 'encode' as a method of $self, i.e.
*** START CODE SNIPPET ***
my @bar = $self->encode($opts{-code});
*** END CODE SNIPPET ***
'encode' expects to be called as a normal sub, not a method:
*** START CODE SNIPPET ***
sub encode_int2of5 {
my $string=shift @_;
*** END CODE SNIPPET ***
This makes the module print a barcode for the value of $self in new, rather than the -code argument. Its easy to fix, e.g.:
*** PROPOSED CHANGE OLD CODE IN new ***
my @bar = $self->encode($opts{-code});
*** PROPOSED CHANGE REVISED CODE IN new ***
my @bar = &encode($opts{-code});
*** END PROPOSAL ***