in reply to md5_hex gives different values for same string

Hi,

First i tried your script on my Windows XP, and it's ok, then i uploaded this script and mil-dic.txt to my SuSe, i ran the script, and Failed..

Then i rm -rf mil-dic.txt, make a new one, run the script again, and its works fine

Replies are listed 'Best First'.
Re^2: md5_hex gives different values for same string
by lyklev (Pilgrim) on Oct 10, 2006 at 22:00 UTC
    Did you copy the file mil-dic.txt from winxp to linux? If so, unix newlines (\n) vs. dos newlines (\r\n) might cause problems. The \r characters are seen as part of the line.

    file mil_dic.txt on most linuxes reveals whether you have dos or unix newlines. You can use the program dos2unix to convert your file. Real perl cracks convert command line: on linux,

    perl -i -p -e "s/\r//" mil-dic.txt
    (converting unix to dos newlines on a windows machine won't work this way, though)

    From lots of experience learnt after countless headaches: whenever there is strange file behaviour, look for the newlines.