Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: problems passing variables between subroutine

by CountZero (Bishop)
on Sep 05, 2012 at 18:40 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-19 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found