Dec 3, 2002, 6:08 PM
Post #1 of 5
Is there a Perl equivalent for C's #include?
I plan to design a web site where each page's content is generated by its own individual Perl script (e.g., home.pl, music.pl, games.pl). There are some global constants (e.g., web site name, email address, etc.) that must be available to each of these scripts. I'd like to continue to use the strict pragma, but I also want to avoid redundantly declaring each of these constant variables in each of my scripts. Is there a way I can include a "globals.pl" file in each of my other scripts, the way I might #include a .h header file in C?
It would also be nice if I could include some globally needed stub functions, such as "print_error()", in this "globals.pl" file.
Please forgive me if a solution to this problem has already been posted in the forum. I hunted for a while but couldn't find anything. Thanks for your time!
Adam [ email@example.com ]