in reply to Please Review First Program: Random Password Generator

That's pretty impressive coding style for your first Perl script.

Here are a few minor style points:

# characters in password my @chars_pool = character_pool(); # default password length my $pass_len = 14; ... # generate password my $password; for (1..$pass_len) { my $random_number = int rand @chars_pool; $password .= $chars_pool[$random_number]; }

Replies are listed 'Best First'.
Re^2: Please Review First Program: Random Password Generator
by hakkum (Acolyte) on Feb 04, 2011 at 02:10 UTC

    Thanks toolic. I am pretty OCD so code cleanliness is almost required for me. I am still new to using modules and Getopt:Long seemed a bit more complicated to use...I was kind of coding in a hurry. so Getopt::Std suited me well at the time. I definitely plan to implement Getopt::Long shortly. I was unaware of Pod::Usage (and 99% of the included modules) so thank you for that; I will check it out. As for the return's, I have made the corrections; thanks again for the customary norms. I'm not too sure where I picked up on pre-declaring my variables, but you're right, it does shorten the overall length and doesn't reduce readability at all.

    I appreciate all the tips. I really want to take my time learning this stuff properly up front as opposed to having to correct ingrained bad habits later down the road.

    -- hakkum

    ...never forget the hakkum bakkum,
    the hakkum bakkum never forgets...