One scenario where the message "Subroutine xyz redefined ..." appears for every function in a Module, is when you have the module on a case insensitive filesystem (such as FAT32) and you required/used it with the wrong case. For example:
# script.pl: use XML::twig; # wrong case, should be XML::Twig # some Module used by script.pl: use XML::Twig;
If you write it with differing upper-/lowercase, then Perl considers them to be different files. As such loading twig.pm and Twig.pm. This works due to the case insensitive filesystem. Since it is however the same file, and it is loaded twice, it will cause all the functions of the package to be redefined. If you 'use' or 'require' the Module with the proper case, then it is only loaded once, and the error will go away.

You say the error message is:
Undefined subroutine &Module::subroutine called at /home/path/module. +pm line 128, <FILE> line 30.
The filename of a Module should typically be the same as the package name (case sensitive!). Check that the package name matches the filename. Also check that the case of &Module::subroutine is correct. &module::subroutine is not the same as &Module::subroutine.

In reply to Re^3: Module not loading completely? by rminner
in thread Module not loading completely? by ric00015

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.