http://www.perlmonks.org?node_id=991914


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