packages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • babno
    New Member
    • Apr 2009
    • 10

    packages

    so, I need to take my program, take out all the subs and put them into a package which is then required by the rest of the program. This seems like it would be pretty easy, but the book in vague and my teacher has a habit of teaching us code that is completely wrong, which is my guess.

    so, I cut all my subs out of the program and put them in a new file named package8.pm (as he told us to) and in my original program (basically just a menu that calls the functions) put
    Code:
    require "package8.pm";
    I try to run in cygwin (a terminal) and get message "package8.p m did not return a true value at lab8.pl line 1.

    yes the name is correct and they are in the same file. so, any help or possible link to a website thats smarter than my teacher could help, thank you.
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    Do you have 1; at the bottom of the file? This tells perl to return true.

    Checkout perlmod


    --Kevin

    Comment

    • babno
      New Member
      • Apr 2009
      • 10

      #3
      I did not, thank you that fixed it. I really wish our teacher could mention things like that

      Comment

      Working...