I'm having trouble exporting a subroutine from an external .pm file.
In the file that calls the subroutine I have the code
#!/usr/bin/perl -wT use strict; use CGI qw(:standard); use lib "/home/public_html/cgi-bin"; use DATA99 qw(WasonE);
From what I understand using that code it should know to look in /home/public_html/cgi-bin for the DATA99.pm file and then call the WasonE subroutine.
In the DATA99.pm file I have
package DATA99; require Exporter; our @ISA = ("Exporter"); our @EXPORT_OK = qw(WasonE); sub WasonE { variables... } 1;
From what I understand from this it packages the DATA99 file and Exports it, then Exports the Subroutine WasonE if a script asks for it (our @EXPORT_OK = qw(WasonE);).
I can get the page to pull up with out one of those fun 500 error messages, but when I look at my error log it says I have a bunch of undefined variables.
If you couldn't tell I'm new to the ways of Perl.

In reply to external subroutine by Anonymous Monk

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.