in reply to Uninitialized string warning

What the others failed explain is that <> only assigns it's value to $_ when it is the entirety of the while's condition. When you added the and bit, it ceased to be special. In other words,

while (<>) {
is equivalent to
while (defined($_ = <>)) {

but
while (<> and ...) {
is equivalent to
while (<> and ...) {

Notice the lack of $_ = in the second case.

That's why
while (defined($_ = <>) and $_ ne ".\n") {
is needed.

Update: It seems that Sandy explained the same thing while I was writting my reply.

Replies are listed 'Best First'.
Re^2: Uninitialized string warning
by Anonymous Monk on May 11, 2005 at 21:55 UTC
    Update: It seems that Sandy explained the same thing while I was writting my reply.

    I am curious. What is the purpose of this update?

      It's a retraction of my "What the others failed explain" qualifier.