Read file into hash in perl?

jdr0317

New member
Okay so something I've never done before in perl, and I am slightly struggling with it. I'm sure this is easy to some people, so here it goes:

I have a file that contains ID's, formatted like this:

AAAA
BBBB
CCCC
DDDD
EEEE
FFFF

etc.

They are all unique, so it would make sense to assign this to a hash, correct?

Then I want to use this hash to compare these values to another set of inputs. Say I have a file of 5 lines, ABBB, AABB, ABAB, and ABBA would not be in the hash, and I would assign a variable equal to 0 to print out. The 5th line's value would be AAAA, which is in the hash, and I would assign a value of 1 to a variable to print. How would I go about this?

Thanks.
 
Back
Top