my $allowed = ##NUMBER ALLOWED##; my @file = ; my $lines = @file; if($lines >= $allowed){ &my_sub() for($allowed..$lines); }