Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: File length ??

by Aristotle (Chancellor)
on Sep 12, 2002 at 18:36 UTC ( [id://197306]=note: print w/replies, xml ) Need Help??


in reply to File length ??

I don't because there's still an end of line marker. You could check for that explicitly:
while(<DATA>){ next if $_ eq $/; push @data, $_; } # shorter: $_ ne $/ and push @data, $_ while <DATA>;
See perldoc perlvar about $/. Or you could remove the linebreaks:
while(<DATA>){ chomp; next if $_ eq ''; push @data, $_; }
See perldoc -f chomp.

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-26 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found