in reply to foreach loop

Because $_ is only available in the scope of the current block. So after the foreach block is finished $_ refers to the read line.

Btw.: You should have expected Suaveaniakobskmerlyboo_radle for using the chop ;-)
--
use signature; signature(" So long\nAlfie");