Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: what's this loo code? (*slurp*)

by Aristotle (Chancellor)
on Feb 04, 2003 at 23:40 UTC ( #232679=note: print w/ replies, xml ) Need Help??


in reply to Re: what's this loo code? (*slurp*)
in thread what's this loo code?

Efficient:

perl -ne'BEGIN{$/=\65536} $a+=tr/\n//; END{print"$a\n"}' file
Pity there's no way to set $/ to a reference to a number using a switch.

Makeshifts last the longest.


Comment on Re^2: what's this loo code? (*slurp*)
Download Code
Replies are listed 'Best First'.
Re: Re^2: what's this loo code? (*slurp*)
by John M. Dlugosz (Monsignor) on Feb 05, 2003 at 03:58 UTC
    If the last line doesn't end with a \n (that is, \n is not the last character in the last chunk) you'll be off by one.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (15)
As of 2015-07-31 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls