Dec 9, 2003 #1 cyberrate Programmer Dec 9, 2003 24 EE Hello i'm new to perl! How can i load a package, a perl module (.pl file) to another .pl file? in PHP it was import "myFile.php"; Java: import "package.*"; How does it work in perl ?
Hello i'm new to perl! How can i load a package, a perl module (.pl file) to another .pl file? in PHP it was import "myFile.php"; Java: import "package.*"; How does it work in perl ?
Dec 9, 2003 #2 PaulTEG Technical User Sep 26, 2002 4,469 IE Depending on your requirements have a look at use or require in the perl documentation HTH --Paul Upvote 0 Downvote
Dec 10, 2003 Thread starter #3 cyberrate Programmer Dec 9, 2003 24 EE Thank you for reply I have a server.pl and db.pl files main file is server.pl i need to call some methods from DB.pl file so i tryed : use DB; use DB(); and i get: 'Cant' locate object method 'printHello' via package DB perhaps you forgot to load DB ? ' Any ideas? Upvote 0 Downvote
Thank you for reply I have a server.pl and db.pl files main file is server.pl i need to call some methods from DB.pl file so i tryed : use DB; use DB(); and i get: 'Cant' locate object method 'printHello' via package DB perhaps you forgot to load DB ? ' Any ideas?
Dec 10, 2003 #4 PaulTEG Technical User Sep 26, 2002 4,469 IE try Code: require "DB.pl"; --Paul Upvote 0 Downvote
Dec 10, 2003 Thread starter #5 cyberrate Programmer Dec 9, 2003 24 EE tryed like this: require "DB.pl"; still shows the same error message, maybe i need to call it differently: DB->printHello(); Regards Upvote 0 Downvote
tryed like this: require "DB.pl"; still shows the same error message, maybe i need to call it differently: DB->printHello(); Regards