Read number of lines in perl