in reply to suppress warning: Exiting subroutine via next

What's wrong with using return?
return unless m/.txt$/i;