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

The first one makes it a bit clearer that you are intentionally looping an infinite number.

I'm not sure about this, but the while loop may also be a tiny bit more efficient in this case.

BREW /very/strong/coffee HTTP/1.1
Host: goodmorning.example.com

418 I'm a teapot

Replies are listed 'Best First'.
Re^4: Memory leak!
by roboticus (Chancellor) on Dec 12, 2011 at 20:20 UTC

    cavac:

    You shouldn't speculate--just measure it with Devel::Benchmark!

    Roboticus ducks and runs while wondering if his machine can do more infinite loops per second than yours... ;^D

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^4: Memory leak!
by ikegami (Patriarch) on Dec 13, 2011 at 02:22 UTC

    How could doing more work (evaluating a constant) be more efficient?

    It's not less efficient either, though. while (CONSTANT) { ... } gets compiled as for (;;) { ... } or (); depending on whether the constant is true or false.