Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import Package

Status
Not open for further replies.

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 ?
 
Depending on your requirements have a look at use or require in the perl documentation

HTH
--Paul
 
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?
 
tryed like this:
require "DB.pl";

still shows the same error message, maybe i need to call it differently:

DB->printHello();

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top