if (crypt($word, $pwd) ne $pwd) {
die "Sorry...\n";
} else {
print "ok\n";
}
####
my $cryptedpass = crypt($passwrd1, substr($never_blank_value, 0, 2));
####
#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
my $never_blank_value = 'T';
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))];
}
die 'Too small \$never_blank_value' if length $never_blank_value < 2;
my $cryptedpass = crypt($passwrd1, substr($never_blank_value, 0, 2));
say $cryptedpass;
__END__
$ perl test.pl
Too small \$never_blank_value at test.pl line 13.
####
#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
my $never_blank_value = 'T';
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))];
}
# die 'Too small \$never_blank_value' if length $never_blank_value < 2;
my $cryptedpass = crypt($passwrd1, substr($never_blank_value, 0, 2));
say $cryptedpass;
__END__
perl test.pl
Use of uninitialized value $cryptedpass in say at test.pl line 15.
####
die 'Not accepted characters at \$never_blank_value'
unless ($never_blank_value =~ /^[a-zA-Z0-9.\/]+$/);