Ronald writes:
= As you say, it is hard to detect infinite loops. :)
No, it is straightforward to detect *any* infinite loop.
But it does take infinite time to detect it. ;-)
peace, || Project Why in Delhi's Giri Nagar slums:
--{kr.pA} ||
Title: why no warning about this infinite loop
# run using e.g. echo hello | perl this-file
# Why doesn't perl produce a warning from the following. It is an
# infinite loop. If I add a /g modifier to the m// it works fine.
while () {
while (m/([a-z])/) { # warning infinite loop!!!
TS == Tolkin, Steve [EMAIL PROTECTED] writes:
TS # run using e.g. echo hello | perl this-file
TS # Why doesn't perl produce a warning from the following. It is an
TS # infinite loop. If I add a /g modifier to the m// it works fine.
TS while () {
TS while (m/([a-z])/) { # warning
On Tue, Jan 27, 2004 at 05:04:03PM -0500, Tolkin, Steve wrote:
# run using e.g. echo hello | perl this-file
# Why doesn't perl produce a warning from the following. It is an
# infinite loop. If I add a /g modifier to the m// it works fine.
while () {
while (m/([a-z])/) { # warning
to the error mechanism.
I am curious if Dan S. has any comments on this w.r.t. Parrot.
Steve
-Original Message-
From: Ronald J Kimball [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 5:33 PM
To: Tolkin, Steve
Cc: [EMAIL PROTECTED]
Subject: Re: [Boston.pm] why no warning about
TS == Tolkin, Steve [EMAIL PROTECTED] writes:
TS OK, My comments below apply to this and Uri's similar comments.
TS I should have said: this infinite loop is easy to detect because:
TS 1. the pattern is constant
TS 2. the data (here $_) is not modified in the loop
TS Both points are
On Tue, 2004-01-27 at 17:41, Tolkin, Steve wrote:
In principle quite complex code can be analyzed
to determine accurately that the data is not modified.
What if the variable in question is actually tied, and a read
operation on the variable actually modifies the value? In certain other
less