in reply to How to check if a file has more than one line?
use strict; use warnings; use File::Slurp; my @array = read_file("filename"); my $lines = @array; if ( $lines == 1 ) { print "total amount of lines are 1"; } else { print "file has $lines lines"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to check if a file has more than one line?
by GrandFather (Saint) on Dec 05, 2014 at 02:01 UTC | |
by james28909 (Deacon) on Dec 05, 2014 at 04:14 UTC | |
by GrandFather (Saint) on Dec 05, 2014 at 04:40 UTC |