Beaker has asked for the wisdom of the Perl Monks concerning the following question:
I've moved to a new server, which has changed my Perl version from v5.10.1 to v5.16.3
The following code is designed to generate a temporary user login password.
srand(time ^ $$); my @passset = ('a'..'k', 'm'..'n', 'p'..'z', '2'..'9'); my $passwrd1 = ""; for (my $i=0; $i<8; $i++) { $passwrd1 .= $passset[int(rand($#passset + + 1))]; } my $cryptedpass = crypt($passwrd1, substr($never_blank_value, 0, 2)); use Babel; my $y = new Babel; my $newpasswrd = $y->encode($cryptedpass, "$passwrd1");
Since moving server the value of $cryptedpass is sometimes undef and throwing warnings from Babel.pm
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: crypt sometimes returning undef
by thanos1983 (Parson) on Feb 14, 2018 at 11:59 UTC | |
by Beaker (Beadle) on Feb 15, 2018 at 11:05 UTC | |
|
Re: crypt sometimes returning undef
by johngg (Canon) on Feb 14, 2018 at 16:55 UTC | |
|
Re: crypt sometimes returning undef
by poj (Abbot) on Feb 14, 2018 at 13:24 UTC | |
by Beaker (Beadle) on Feb 15, 2018 at 12:09 UTC | |
|
Re: crypt sometimes returning undef
by hippo (Archbishop) on Feb 14, 2018 at 10:24 UTC | |
by Beaker (Beadle) on Feb 14, 2018 at 10:28 UTC |