perlquestion
rvosa
Dear monks,
<br /><br />
I am looking for a (moderately) portable way of running system user authentication. I thought I understood from the perldocs that the following would work in an ideal world:
<code>
use strict;
use warnings;
my @pwstruct = getpwnam('me');
my $plain = '****';
my $encrypted = $pwstruct[1];
if ( crypt( $plain, $encrypted ) eq $encrypted ) {
print "ok";
}
</code>
but it neither does on OSX (10.4, intel) nor on x86 red hat (not sure if these are "ideal world") so I guess I misunderstood. What am I missing?
<br /><br />
Thank you!