Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: a one-liner for this trivial problem?

by kcott (Archbishop)
on Apr 16, 2013 at 17:37 UTC ( [id://1028973]=note: print w/replies, xml ) Need Help??


in reply to a one-liner for this trivial problem?

Something like this perhaps:

$ cat 1028930_short 2 5 6 8
$ cat 1028930_long 1 2 3 4 5 6 7 8 9
$ perl -i -nE 'chomp; if ($s) { $d{$_} or say } else { ++$d{$_}; ++$s +if eof; say }' 1028930_short 1028930_long
$ cat 1028930_short 2 5 6 8
$ cat 1028930_long 1 3 4 7 9

-- Ken

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-23 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found