sub numlines { my $file = shift @_; unless (open FILE, "$file") { warn "Could not open $file: $!\n"; return -1; # Only a recommendation } my @lines = ; close FILE; return scalar @lines; }