Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Answer: How can I write and call subroutines in separate files?

by btrott (Parson)
on Mar 22, 2000 at 11:29 UTC( #5881=categorized answer: print w/replies, xml ) Need Help??

Q&A > subroutines > How can I write and call subroutines in separate files? - Answer contributed by btrott

I think you're best off looking into putting your code into a module, whether that be basically a collection of utilities (where you may export certain routines) or an actual OO application. Which option you choose should depend on whether your program lends itself to an OO model--this won't necessarily be the case.

Take a look at use, package, perlmod, and the Exporter manpage. If you choose to go the object route, there's perlobj and some tutorials: perltoot and perlboot.

  • Comment on Answer: How can I write and call subroutines in separate files?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2016-08-30 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (411 votes). Check out past polls.