Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: subroutine calls itself

by tux402 (Acolyte)
on Jan 09, 2009 at 16:14 UTC ( [id://735227]=note: print w/replies, xml ) Need Help??


in reply to Re: subroutine calls itself
in thread subroutine calls itself

I was just hoping that if the program is looping over and over that it won't suck up all my servers resources. As long as the program performance doesn't grow without bounds, I'm good.

Replies are listed 'Best First'.
Re^3: subroutine calls itself
by CountZero (Bishop) on Jan 09, 2009 at 19:05 UTC
    I was just hoping that if the program is looping over and over that it won't suck up all my servers resources.
    That is entirely up to the content of the sub-routine. If each call to your sub-routine fills a lexical array with a million floating point values and before you end the subroutine you call it again (and again, and again, ...) it will not take long before you exhaust your memory and then the swap-space and then your server dies. As such that has nothing to do with the fact that the subroutine calls itself, just that it was written badly.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-24 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found