Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: File length ??

by Aristotle (Chancellor)
on Sep 12, 2002 at 18:36 UTC ( #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? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2022-08-11 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?