Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Ahh, The flurry of posts on this one is going to be great. As the answer is 1; we should deleve into the depths of this problem in detail. The question you should be asking yourself, young one, is "Why didn't I believe the compiler?"

Obviously, you have never learned that perl modules need to return a true value at the bottom of the code. This answer is obvious. Where then, could you have gotten this information from?

  1. You could go to perl monks and ask. Which you did... not a bad way, and it gives us something to talk about. But I'm sure right now that you asked on the chatbox.
  2. read perldoc perlmod It clearly states in there how to go about building a module including using the true value at the end.  1;  # don't forget to return a true value from the file
  3. You could have read perldoc -f use. This would have told you
    BEGIN { require Module; import Module LIST; }
    which hopefully would have sent you to perldoc -f require. There it states
    $result = do $realfilename;
    delete $INC{$filename} if $@ || !$result;
  4. Read another perl module. As your syntax is fine (and easy to check with perl -c), you must have realized that you were missing something specific to modules. Another module would have answered that for you.
Oh Monk! This is not a rebuke of your programming skill, you know now what you need.
Oh Monk! This Sangha is here to help! But asking here is like making a wish, you may get what you asked for, and much more.
Oh Monk! Strive unceasingly towards Perl Perfection. You have violated the Law of Laziness, far easier to ask a quick question than post a long code snipit.

In reply to Re: Creating a module by Crulx
in thread Creating a module by TStanley

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2023-03-25 01:38 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (62 votes). Check out past polls.