Sure-- this stuff works ok almost all the time. The sporadic behavior is one that is hard to describe, really. But, to answer your question, here's some code: (note the inclusion of the Register module)

MyUserProfile.pm

package MyUserProfile; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(ProfileGet ProfileSave ProfileEdit ProfileUpdate ProfileFix ProfileExtract ProfileFixContactInf +o $user_data $contact_strings, @contact_info); our $VERSION = 1.00; use MyErrors; use CGI; use Register qw(PrintTemplate RegisterChange RegisterAcctPath Register +SetupUser EDIT_PROFILE VIEW_IMAGES read_user_db); use MyUtils qw(:DEFAULT);

Now, here's a snippet from Register:

Register.pm

[...] use MyUserProfile qw(:DEFAULT); [...sometime later in some function...] my $acct_data = MyUserProfile::ProfileGet($acct); [...]

Even though ProfileGet() is properly exported, I can't just call it without perl complaining about Register.pm calling an undefined function. I have to use it in the form above to get it to shup up (and work). But this is the frustrating part: it's not ALWAYS the case. Sometimes, functions can be called directly, whereas other times, maybe not. Maybe there's a pattern to when it works and when it doesn't, but suffice to say, I can't see it (hence, the appearance of randomness).

Could the inter-dependence on the modules to one another be causing this, or point to the direction of the problem?


In reply to Re^2: error for undefined function that's been imported by argv
in thread error for undefined function that's been imported by argv

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.