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
> "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>
OK, My comments below apply to this and Uri's similar comments.
I should have said: this infinite loop is easy to detect because:
1. the pattern is constant
2. the data (here $_) is not modified in the loop
Both points are obvious to a person.
In this simple and important special case
it is
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])/) { #
> "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
Thanks for the explanation.
So this is a documented "feature".
I was fooled by believing the general principle that special
characters are special unless escaped with a backslash.
I would have greatly preferred consistency in this.
Are there other known (and perhaps even documented) violations
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
On Tue, Jan 27, 2004 at 04:55:28PM -0500, Tolkin, Steve wrote:
> # run using e.g. echo hello | perl this-file
>
> # Why doesn't perl produce a warning from {3-8} ? This seems
> # to be a syntax error. It surely is not the way to match strings of length
> 3 - 8. It
> # should be {3,8} .
>
>
Title: using {3-8} instead of {3,8} doesn't produce even a warning?
# run using e.g. echo hello | perl this-file
# Why doesn't perl produce a warning from {3-8} ? This seems
# to be a syntax error. It surely is not the way to match strings of length 3 - 8. It
# should be {3,8} .
while
9 matches
Mail list logo