use strict; use overload "<>" => \&bin_iterate; while (<>) { . . . }