in reply to Putting text file into a hash

Hello,

I'm no monk at all. Was actually stopping by to post my own question, but I think I can help you here. You can set it by doing this:

open FILE1, "text_file_with_words.txt" or die;
%hash = map {chomp; split /:/} (<FILE1>);

I hope that helps.


-Sean
AKA: Morpheous1129

Replies are listed 'Best First'.
Re^2: Putting text file into a hash
by Anonymous Monk on Oct 17, 2008 at 19:09 UTC
    Aa crap!! Looks like one of the monks already responded with the answer. Sorry then.

    -Sean
    AKA: Morpheous1129