Are you *sure* this is the code you're running? When I run it, I get "Not a coderef" (after installing Barcode::DataMatrix)
That error is caused either when you call a legit method on a class/object, but you haven't use Barcode::DataMatrix; (but you have), or you've loaded the module, but the method doesn't exist (in this case it does). This is often caused by a typo... like typing new() as nw() by accident.
Test this yourself with this tiny sample and see what happens...
use strict; use warnings; use Barcode::DataMatrix; use Safe; my $mat = Barcode::DataMatrix->new()->barcode( 1 ); print $mat;
You should get similar output to this:
$ ./bc.pl ARRAY(0x1960758)
In reply to Re: Safe.pm, Barcode::DataMatrix, Can't locate object method "new" via package "Barcode::DataMatrix"
by stevieb
in thread Safe.pm, Barcode::DataMatrix, Can't locate object method "new" via package "Barcode::DataMatrix"
by Tharg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |