in reply to Re^2: Memory leak!
in thread Memory leak!

for(;;){ isn't actually an error.

This is intentional. In both C and Perl, any combination of the three expressions can be omitted.

Replies are listed 'Best First'.
Re^4: Memory leak!
by BrowserUk (Patriarch) on Dec 13, 2011 at 03:46 UTC
    This is intentional. In both C and Perl, any combination of the three expressions can be omitted.

    I know.

    It means that instead of this:

    C:\test>perl -E"while(<>){ print }" hello hello goodbye goodbye ^Z

    We could write:

    C:\test>perl -E"for(;<>;){ print }" fred fred bill bill john john ^Z

    But few, if any, would.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Sure, which is why noone does it. (1 down, 7 to go!)