Your file Syringe.pm still contains errors that strict.pm cannot let pass. So you are still loading the wrong Syringe.pm file (or loading the right one but modifying/posting the wrong one).

First test that Syringe.pm compiles well:

perl -Ilib -MSyringe -e1

If this command raises any errors, then they are in Syringe.pm.

Then, go on to put this into a (very small) Perl script:

#!perl -w use strict; use Syringe; print "OK\n";

Get this script to run.

After that, continue to add stuff until it breaks again (but by then, it shouldn't).

When debugging some "magic module loader" stuff (which I've since come to abhor, for the ugly things hidden by magic module loading), I've often resorted to putting BEGIN blocks into the modules that output "I am here" messages:

package My::Module; BEGIN { print "Loading " . __PACKAGE__ . " from " . __FILE__ . "\n"}; ... the methods in My::Module ... print "Loaded " . __PACKAGE__ . " from " . __FILE__ . "\n"; 1; __END__

This spews a lot of messages, but on the upside, you get a trace of what module gets loaded from where (and when). If there is a "Loading..." message, but no corresponding "Loaded..." message, then you know that there was an error and something along the way gobbled up and hid that error instead of stopping execution.


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.