"So so tired, here the time is 4:50 am. ..."

Then get some sleep!

"I did read Exporter quickly not thoroughly ..."

Well there's a problem! Go and read it, not just glance at it, after you awake and are refreshed.

"... but the code that I am using is taken from Simple Module Tutorial, ..."

No, it's not! Look again, after you awake and are refreshed.

"... so I assume it should work straight out of the box."

I don't think it would have got Reputation: 315 (no significant downvotes), if it didn't work.

However, you're not using it "straight out of the box". You've made significant changes to it!

After you've had some sleep and are refreshed, go through the tutorial code and your code, line by line, and note all the differences.

Then, the next step will be to make your code look more like the tutorial code. When you've done that, you'll probably find that it works just fine.

-- Ken


In reply to Re^5: Undefined subroutine &main::func1 by kcott
in thread Undefined subroutine &main::func1 [SOLVED] by thanos1983

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.