You are right to use the while loop. However, if you are continually running
the same command and storing that value in $foo, how can you expect it to
change? Does the external program change it's return value?

Can you explain in more detail what you are trying to achieve.

This example shows how the while loop will halt.

$bar = 10;

while ($foo <= $bar) {
        print "$foo\n";
        $foo++;
}

HTH

John

-----Original Message-----
From: Mark Richmond [mailto:[EMAIL PROTECTED]]
Sent: 05 February 2002 03:50
To: [EMAIL PROTECTED]
Subject: Newbe looping questions



How do I loop until the value of variable changes?
In this example at some point the value of $foo 
will change and I can continue
It seems that I need to re-eval the value some how 


$bar = foo ; 
$foo = qx(os_cmd); # sets $foo to foo 

while ($foo eq $bar) {
    $foo = qx(os_cmd); 
    print "Print loop forever \n";
}

This just loops forever It never sees that the value 
of $foo because it's in the loop. What an I missing 

        -mark


- 
Mark Richmond <[EMAIL PROTECTED]> 
Airvana Inc. 
25 Industrial Ave. 
Chelmsford, MA 01824 
Voice: 978-250-2669 
Fax:   978-250-3910 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to