Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Select only desired features from a text

by RichardK (Parson)
on Mar 19, 2012 at 12:24 UTC ( #960403=note: print w/replies, xml ) Need Help??

in reply to Select only desired features from a text

Well, that depends on how many lines there are in second file. The easiest way is to store the matched records in a hash.

You might find it useful to look at the perl data structures cookbook perldsc

BTW, there is lots of documentation shipped with your copy of perl - try 'man perl' or 'perldoc perl' ;)

  • Comment on Re: Select only desired features from a text

Replies are listed 'Best First'.
Re^2: Select only desired features from a text
by remluvr (Sexton) on Mar 19, 2012 at 14:12 UTC
    Problem is, it is a 4G file..

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960403]
[ambrus]: Corion: Maybe I'm not explaining the situation clearly enough, maybe I'm just wrong and he's right and we can compute that data,
[ambrus]: but hopefully he just wants to think it through himself his way and understand why it's impossible rather than blindly accept my argument.
choroba quickly peeps in from a café
[1nickt]: Good morning Monks of the world!
[Corion]: ambrus: Yeah, hopefully it's that
[1nickt]: I am stumped, maybe someone brainy can clear my mind?
[1nickt]: This code does what I expect on the CLI: perl -wE 'sub x { 0 and 1 } say x()'
[1nickt]: (prints "0")
[Corion]: Hi 1nickt!
[1nickt]: When I put it in a file, I get the following: "Replacement list is longer than search list at line 4. syntax error at line 4, at EOF ...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-12-12 13:36 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (332 votes). Check out past polls.