http://qs1969.pair.com?node_id=470418


in reply to Favourite One-liners?

It is impossible for me to have a favorite one-liner. Anything I have to type often enough to become a "favorite" would have already been comitted to a script so I wouldn't have to recreate it every time.

That said, your code perl -e 'print <>' filename is a pathological form of cat filename, type filename, or perl -pe1 filename. You load the entire file into memory before printing it while the operation should normally only load a single line at a time (ignore the buffer, please). You're wasting tons of memory when you do that and for no good reason.