Angel has asked for the wisdom of the Perl Monks concerning the following question:

I cant figure this out this is a test program since I can't get the part that is in the real program to work. I dont have the otpion of using the MD5 module so I figured i'd open up a pipe to shell for the md5 command provided by UNIX.

But it won't work and I think I am probably missing something elementary. I looked online and did not get any ideas. Any clue what i am doing wrong?

#!/usr/local/bin/perl #password correctness md5 direct insert from UNIX hash open( CRYPT , "MD5 -s $ARGV[0] |" ); $password_hash = <CRYPT>; close( CRYPT ); print $password_hash;

Replies are listed 'Best First'.
Re: Password Hashing Issues
by zigdon (Deacon) on Oct 31, 2002 at 19:46 UTC
    Just a hint - your open is failing, and you don't know, because you're not checking the return of the open command. Try this:
    open( CRYPT , "MD5 -s $ARGV[0] |" ) or die "Can't open: $!";

    -- Dan

Re: Password Hashing Issues
by fglock (Vicar) on Oct 31, 2002 at 20:53 UTC

    It's "md5", not "MD5".