Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

( #7490=categorized answer: print w/ replies, xml ) Need Help??

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

You can break up the code into logical units:
# file one use File2; setup(); main(); sub main { print "I am in the main subroutine.\n"; } # file 2 sub setup { print "Setting up.\n"; } 1; # use'd files have to return true!

Comment on Answer: How can I write and call subroutines in separate files?
Download Code
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 drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-02-10 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (343 votes), past polls