in reply to How do i count lines from data file?

Could try something like this.
my $allowed = ##NUMBER ALLOWED##; my @file = <DATA>; my $lines = @file; if($lines >= $allowed){ &my_sub() for($allowed..$lines); }