Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: A question about the best way to use subroutines

by tune (Curate)
on Mar 25, 2001 at 10:53 UTC ( #66976=note: print w/replies, xml ) Need Help??


in reply to A question about the best way to use subroutines

Sometimes it is good just to work out the steps of your program in different subroutines. It makes it very understandable and clear.
E.g. i am sleepy now, so
#!/usr/bin/perl &stand_up(); &brush_teeth(); &go_to_bed(); &fall_asleep(); exit (0); # i don't go into details about the subs now :-)
Sometimes it is very useful to store your reusable routines in separate files, in a common directory, and include them in your script, but be careful, too much include files messes up everything. Be smart. :-)

-- tune

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://66976]
help
Chatterbox?
[LanX]: interpolation! like in a "string"
[Lady_Aleena]: LanX, I just never thought I would be explaining perl regex to others. It is usually others explaining why a regex isn't working to me.
[Discipulus]: congratulations shmem! (was my last upvote? ;=)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2017-04-28 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (520 votes). Check out past polls.