Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Perl software on multiple files

by Perlbotics (Archbishop)
on Sep 25, 2011 at 13:02 UTC ( [id://927747]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl software on multiple files
in thread Perl software on multiple files

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).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://927747]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-25 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found