G'day curucahm,

Welcome to the Monastery.

Your problem is package-related. The error message indicates that Perl is looking for your subroutine in main (the default package); however, your code has that subroutine in package ScriptLibs::Menu.

If you don't know about packages, see the documentation in package for basic information. It has links to further details: follow them as required.

[Aside: You've included far too much code in your post. Most of it does not relate to the problem at hand. I only read the error message and then looked for "sub MenuNA" in your code. It's better to post a short piece of code that reproduces your problem; in fact, doing this will often highlight the problem for you. Please see "How do I post a question effectively?" for more discussion regarding this. When you do need to post "pages" of code, please use <spoiler> or <readmore> tags: "Writeup Formatting Tips" has more about this.]

Update: Having seen AM's response, my "problem is package-related" is wrong. I have stricken that part of my post. Please ignore.

— Ken


In reply to Re: Subroutine not being found when being called from within its own module. by kcott
in thread Subroutine not being found when being called from within its own module. by curucahm

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.