Update: I'm an idiot. I had a typo, as toolic has pointed out. Thanks.

I'm seeing some odd behaviour that someone will no doubt be able to explain.

If I try to use a module method without using the module first, I get a somewhere misleading error ..

[foo@bar test]$ perl -de 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 DB<1> $time = Time::Local::timelocal(0,0,13,26,8,2009) Undefined subroutine &Time::Local::timelocal called at (eval 7)[/fooba +r/system/pkg/perl-5.8.6/lib/5.8.6/perl5db.pl:628] line 2.
Yet both of the following are fine:
[foo@bar test]$ perl -de 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 DB<1> use Time::Local DB<2> $time = Time::Local::timelocal(0,0,13,26,8,2009) DB<3> x $time 0 1253962800
and
[foo@bar test]$ perl -de 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 DB<1> use Time::Local DB<2> $time = timelocal(0,0,13,26,8,2009) DB<3> x $time 0 1253962800
However, declaring the module from the command line doesn't work ..
[foo@bar test]$ perl -MLocalTime -de 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. Can't locate LocalTime.pm in @INC (@INC contains: /foobar/system/pkg/p +erl-5.8.6/lib/5.8.6/sun4-solaris /foobar/system/pkg/perl-5.8.6/lib/5. +8.6 /foobar/system/pkg/perl-5.8.6/lib/site_perl/5.8.6/sun4-solaris /f +oobar/system/pkg/perl-5.8.6/lib/site_perl/5.8.6 /foobar/system/pkg/pe +rl-5.8.6/lib/site_perl /foobar/system/lib/site_perl .). at -e line 0 main::BEGIN() called at LocalTime.pm line 0 eval {...} called at LocalTime.pm line 0 BEGIN failed--compilation aborted. at -e line 0 Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info.
Can someone point me to what's happening here? Thanks.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds


In reply to Module hide and seek by talexb

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.