Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009

    Unanswered: How to include file in perl


    I have one question I have two file and in I have all subroutine and calls all the subroutine so I want to use require in in But I am getting below error message. did not return a true value at

    Can any one help me to resolve this?

    Is there any module required for that?


  2. #2
    Join Date
    Oct 2002
    Baghdad, Iraq
    Sure. A perl module is actually run when it is used or required, and these functions will check the return value. So a sophisticated module can check for problems, and indicate them by return a false value.

    If you're not checking for errors, all you need to do is make sure to return a true value, which is typically done by adding this to the end:

    Another note: generally, .pl indicates a script that actually does something, whereas .pm (for Perl Module) indicates a collection of related subs.

    Recommended reading about perl modules. Especially, see the notes on the distinction between use and require. That whole site is very nice, of course, it is really just a copy of all the excellent documentation by typing:

    perldoc perl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts