in reply to Re: sub that sets $_
in thread sub that sets $_

remember that for (LIST) localizes $_ and while (<HANDLE>) doesn't. Generally, for() is safer, but sometimes you want the while() behaviour.