in reply to "Useless use of private variable in void context"

I would look at the line right before this one:
my $generated_password = &GeneratePassword;