Please don't do that. This approach usually becomes a great global mess before your
system has a chance to grow big.
Read Including files again, esp. the first section that hints not to follow the PHP path.
The free Modern Perl book
has specific chapters about modules (i.e.: Managing Real Programs, p. 201ff.)
(...as already suggested by GrandFather and AM).
Then refactor your code into modules (*.pm not *.pl BTW) that can be re-used
and properly encapsulate/abstracts functionality.
Check first if the functionality required is already available
as a core module or a download from CPAN.
Decide if it is better to have a functional- (what you do now)
or an OO-interface and what really needs to be exported into your main.pl ($main::) namespace.
Since you didn't gave us much details, it is hard to give you more specific advice (see ww's comment below).
BTW: The &function() syntax is usually/probably not what you want (circumvents prototypes;
makes current @_ visible to called sub; see perlsub for details).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||