in reply to Tact and the Monastery
I'm always leery of these "this other guys code was a mess"
comments. Certainly it's sometimes (mostly?) true, but "messy" is in the eye of the beholder.
For example, I tend to use lots of temporary variables where
they probably aren't needed. I've gotten negative feedback
on that. I think, however, that they make the code more
Now, the @chars and $salt variables aren't really needed, and I could
have done something like:
# crypt the password
my $salt= $chars[rand(@chars)] . $chars[rand(@chars)];
which is more compact, but less readable, IMO.
my $crypted = crypt( $password, join( '',
('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]));
I've also gotten negative feedback on code reviews for
overly defensive programming, which again, adds lines
of code and generally makes for more "mess". ( additional
eval blocks, lots of defined() calls, etc).