#!/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.