You can be a little more succinct:
#!C:\Perl\bin use diagnostics; use strict; my $twoLines = 2 == grep {defined <DATA>} 1 .. 2; print "Two or more lines\n" if $twoLines; __DATA__ 1 2
In reply to Re^4: How to check if a file has more than one line?
by GrandFather
in thread How to check if a file has more than one line?
by bobo33+
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |