Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991914]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-12-16 13:31 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (453 votes). Check out past polls.