Thanks for the input everyone. The @EXPORT was a desparate attempt to fix the problem. I should have taken it back out. Here are the complete program and module in a more minimalist form.
Here is syringe.pl
#!/usr/local/ActivePerl-5.10/bin/perl -w use strict; use warnings; use Syringe; print $INC{"Syringe.pm"}; my $syringe = Syringe->new(); print "Wohooooo!";
and here is syringe.pm, which is in the same directory.
#Package Syringe package Syringe; use strict; use warnings; @ISA = qw(Exporter); @EXPORT = qw(); @EXPORT_OK = qw(); use constant PI => 4 * atan2 1, 1; sub new { my $class = shift; my $self = {}; bless $self, $class; $self->{picture_width} = $args{picture_width}; return $self; } 1;
When I run it, I get the following results. The "use lib" line is not strictly necessary, but it forces the full module path to be printed, which assures me that there isn't some other Syringe.pm that I'm loading. The result is essentially the same as before. I'd be tempted to blame some misconfiguration in the Komodo environment, but I have other module/program pairs that I can run without problems.
Can't locate object method "new" via package "Syringe" (perhaps you fo +rgot to load "Syringe"?) at /Users/phowell/Documents/Work/Programming +/Syringe/Syringe.pl line 8. /Users/phowell/Documents/Work/Programming/Syringe/Syringe.pm
In reply to Re: Can't locate object method "new" via package ... perhaps you forgot to load...Oh yes I did!
by Phemto
in thread Can't locate object method "new" via package ... perhaps you forgot to load...Oh yes I did!
by Phemto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |