Either that, or I'm going nuts.

I've been adding a test suite to our app. Everything's going smoothly. Then I try an install and I get an error. I write a minimal test case for it. Error is:

F/Ast/Action.pm did not return a true value at tmp.pl line 4. BEGIN failed--compilation aborted at tmp.pl line 4.

line 4 is the use statement loading the module. So, I take a look at it. It ends in a "1;" on it's own line.

perl -c F/Ast/Action.pm gives no errors or warnings.

So I start ripping out subs to create a minimal case. I end up with this:

package F::Ast::Action; use Switch; use strict; use warnings; =over 4 =item constants =back =cut sub new { return bless [], shift; } sub doCmd { my $self = shift ; my $cmd = shift ; switch ($cmd) { case 'get_permission' {} } } 1;

Here's where it gets weird. If I remove the pod, the test script works fine. If I put it back and remove the doCmd sub, it works just fine. And if I move the module into the same directory as the test script (renaming and amending use statement), it works fine.

I am very, very confused.

Any ideas as to what my sleepy head could be missing? I'm about ready to start headbutting the keyboard...


In reply to Extremely weird module issue... by cLive ;-)

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.