open(FILE,"/path/to/file.txt") or die "could not open file: $!"; my @_lines = ; # After I open the file for reading close(FILE); my $_numOfLines = scalar @_lines;# Is that right? I think it is, but my mind is rusty, been a while since I learned all of the perl programming