http://www.perlmonks.org?node_id=338766


in reply to using strict

Those my declarations are only effective to the end of the enclosing block .. i.e. the one if/else clause in which each one appears.

Moving them up to the top of the while block should suffice.

    -- Chip Salzenberg, Free-Floating Agent of Chaos