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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you make a function accessible to all files 1

Status
Not open for further replies.

pujas

Programmer
Feb 2, 2005
22
0
0
US
Hi,
In perl without packages is there a way to make a function accesible to other perl files?
 
I dont think so.
Modules are pretty damn easy to write and will allow you to do what you want.
I just looked at a few standard ones and copied the format.
 
Have you checked Mike's lovely FAQ on the different include syntaxes?

________________________________________
Andrew

I work for a gift card company!
 
Why can't you use the "Require" function...

I use this to great effect when I have sub routines i use all the time...

require 'Drive letter:/full server path to CGI bin/name of file.cfg';

i tend to use the .CFG on the end to easily distinguish between the global sub routines and each perl script itself.

Hope that helps.

1DMF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top