#! /usr/local/bin/perl
#
# perl function interface to /usr/local/ssl/bin/md51
#

sub md5_crypt {

  use FileHandle;
  use IPC::Open2;

  local($user, $pw) = @_;

  $pid = open2( \*Reader, \*Writer, "./md51" );

  Writer->autoflush(); # default here, actually
  print Writer "$user:$pw\n";
  close Writer;
  $md = <Reader>;
  close Reader;
  chop $md;

  return $md;
}

$x = &md5_crypt( "frodo", "abc");

print "$x";
