in reply to Stumped with $_ being modified

Actually, very recently ihb and I were discussing exactly your problem (missing local $_;) starting approximately here.

-- Hofmator