Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How to check if a file has more than one line?

by karlgoethebier (Abbot)
on Dec 05, 2014 at 07:39 UTC ( [id://1109330]=note: print w/replies, xml ) Need Help??


in reply to How to check if a file has more than one line?

Take a look at Count number of lines in a text file.

Update: my 2 cents...

use strict; use warnings; use IO::All; my $file = shift || die $!; my $io = io $file; print qq(I think it's more than one!\n) if $io->[1];

Note: "IO::All file used as an array reference becomes tied using Tie::File".

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1109330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found