Connecting Tech Pros Worldwide Help | Site Map

packages

Newbie
 
Join Date: Apr 2009
Posts: 10
#1: Apr 27 '09
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
Expand|Select|Wrap|Line Numbers
  1. require "package8.pm";
I try to run in cygwin (a terminal) and get message "package8.pm 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's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 900
#2: Apr 27 '09

re: packages


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

Checkout perlmod


--Kevin
Newbie
 
Join Date: Apr 2009
Posts: 10
#3: Apr 28 '09

re: packages


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