Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: extract line

by rjt (Deacon)
on Jul 20, 2013 at 20:56 UTC ( #1045469=note: print w/replies, xml ) Need Help??


in reply to Re: extract line
in thread extract line

How about this?

perl -pe'open _,file2;0+$_~~[<_>]or$_=""' file1

47 chars, versus 91 (84, removing unnecessary whitespace). This one's definitely "just for fun", though, due to now-experimental smartmatch and re-reading of file2.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045469]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2016-12-03 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (56 votes). Check out past polls.