Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Edit huge file

by zork42 (Monk)
on Jun 19, 2013 at 15:44 UTC ( #1039794=note: print w/replies, xml ) Need Help??


in reply to Edit huge file

rjt + BrowserUk : what is the 'l' doing in your one-liners that start with:
perl -nle"..."
?
I've read the perlrun documentation but I'm not really much wiser.

Replies are listed 'Best First'.
Re^2: Edit huge file
by BrowserUk (Pope) on Jun 19, 2013 at 16:30 UTC
    what is the 'l' doing in your one-liners that start with: perl -nle"..."

    Literally, it autochomps input and auto-appends $\ for print statements.

    Generically, it is useful when using print as it avoids having to append "\n". Also, when comparing with literals, the autochomping avoids having to add the "\n" into the literals.

    In the specific case of my one-liner in this thread, it is redundant and actually slows the solution down by ~20%. So good catch++.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039794]
help
Chatterbox?
[zentara]: LanX One day, I will see a great interest in Tk. It's small, self-contained, needs very few external libraries, AND makes it easy to make high-contrast displays. :-)
[zentara]: Corion in this cased they left the www. out
[zentara]: /d// :-)
[LanX]: i like tk, just joking. but what about modern styles?
LanX has to run. .. o/
[zentara]: modern styles are secondary to display readability. Tk is automatically good at the clunky industrial theme. :-)
[ww]: Amen!

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-05-26 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?