Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 contemplating the Monastery: (3)
As of 2025-06-22 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.