in reply to Count number of lines?
my $lines = 0; open USERDAT, 'users.dat' or die "can't open users.dat: $!\n"; $lines++ while (<USERDAT>); close USERDAT; # now lines has the number of lines. [download]