map {print; smtp->datasend($_)} reverse splice(@lines, -25); #### Open the file; Create an IO::Select object that watches fh; while ($hours < 72){ if (IO::Select object->can_read(short_timeout){ read all available data ship off the last 25 lines in a mail } sleep; }