in reply to Safe.pm, Barcode::DataMatrix, Can't locate object method "new" via package "Barcode::DataMatrix"
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Safe.pm, Barcode::DataMatrix, Can't locate object method "new" via package "Barcode::DataMatrix"
by Tharg (Scribe) on Jul 19, 2015 at 14:56 UTC | |
by tangent (Parson) on Jul 19, 2015 at 15:15 UTC | |
by Tharg (Scribe) on Jul 19, 2015 at 15:23 UTC | |
|
Re^2: Safe.pm, Barcode::DataMatrix, Can't locate object method "new" via package "Barcode::DataMatrix"
by Tharg (Scribe) on Jul 19, 2015 at 15:31 UTC |