Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Favourite One-liners?

by diotalevi (Canon)
on Jun 27, 2005 at 23:40 UTC ( #470418=note: print w/replies, xml ) Need Help??


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.

Replies are listed 'Best First'.
Re^2: Favourite One-liners?
by ghenry (Vicar) on Jun 27, 2005 at 23:48 UTC

    The reason is just because I always remember it. No other reason than that.

    There are plenty of other versions available if I was really concerned about it though, but thanks anyway.

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://470418]
help
Chatterbox?
[erix]: a few years ago there was suddenly the news that the Kremlin was using typewriters again. Heard nothing about it afterward
[erix]: (maybe that means it worked)
[oiskuu]: Yeah, it might work as long as there are no root exploits. ;-)
[Corion]: Also, it's much harder to leak paper sheets than it is to leak documents that are available electronically
[oiskuu]: tye, do you make use of remote logging?
[oiskuu]: erix, this gives a new definition to e-paper: something that records the pressure imprints and is bluetooh capable, looks like ordinary paper.
[oiskuu]: So to be really, really sure, you must microwave the paper before you type on it.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-06-23 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (555 votes). Check out past polls.