in reply to Re: Can't locate object method "new" via package ... perhaps you forgot to load...Oh yes I did!
in thread Can't locate object method "new" via package ... perhaps you forgot to load...Oh yes I did!

Your description is not consistent with the code you provide! Syringe.pm does not compile due to the exporter related lines and due to the $self->{picture_width} = $args{picture_width}; line.

The output from the print $INC{"Syringe.pm"}; line is consistent with a file called Syringe.pm being found in the same directory as the .pl file so the implication is that the file being loaded is not the one you think it is. Have you two files with different case perhaps, or maybe the file you are editing is in a different directory than the .pl file, but there is an old version of the .pm that is being found?

True laziness is hard work
  • Comment on Re^2: Can't locate object method "new" via package ... perhaps you forgot to load...Oh yes I did!
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: Can't locate object method "new" via package ... perhaps you forgot to load...Oh yes I did!
by Phemto (Acolyte) on Jan 29, 2011 at 10:39 UTC

    GrandFather gets the cigar - along with everyone else who told me that it couldn't be the same file. When I followed his advice and stopped trusting the IDE, and went back to the terminal, it was obvious. That explains why I wasn't seeing the compilation errors, even when I "asked for them."

    I hunted down the files that were getting loaded, moved them to my working directory, and made sure the IDE was pointing to them. Now I'm getting lots of reassuring syntax errors.

    My lesson: It's not true laziness to depend on the IDE. When in doubt, drop to the command line and make sure you really know whats going on.

    Thanks Folks!

      I use Komodo all the time for Perl development under Windows. If I hover the cursor over a document tab it shows me the full path to the document. In a case like this that is a worth while sanity check!

      True laziness is hard work