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

Re^3: problems passing variables between subroutine

by CountZero (Bishop)
on Sep 05, 2012 at 18:40 UTC ( #991914=note: print w/ replies, xml ) Need Help??


in reply to Re^2: problems passing variables between subroutine
in thread problems passing variables between subroutines

look_through_file uses and updates $continue_tag, but the result is not used

It is supposed to be used. When the end of file is reached the $continue_tag goes to "FALSE" and this gets passed out of the subroutine from which point the while loop (that makes the subroutine calls in the first place) is broken.

The value of $continue_tag gets passed out of the subroutine indeed and is immediately discarded because there is no variable to store it in.

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

My blog: Imperial Deltronics


Comment on Re^3: problems passing variables between subroutine
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-07-28 07:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (193 votes), past polls