#!/usr/bin/perl use strict; use warnings; use IO::InnerFile; open(my $fh, "< test_data"); my $inner = IO::InnerFile->new($fh, '100', '50'); while (<$inner>) { print; } close($fh);