Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Tact and the Monastery

by Aristotle (Chancellor)
on Sep 15, 2002 at 07:55 UTC ( #198009=note: print w/ replies, xml ) Need Help??


in reply to Re: Tact and the Monastery
in thread Tact and the Monastery

I find your first example unnecessarily noisy, while the second is too golfish. Balance is key. Mine would look like so:

my @chars = ('a' .. 'z', 'A' .. 'Z', 0 .. 9, '.', '/'); my $crypted = crypt $password, $chars[rand @chars].$chars[rand @chars] +;

That way I can't make a mistake in the size of the list vs the constant passed to rand. Nor will I have to figure out why I used 64 there if I read the source again in a year. It also lets me use concatenation vs the noisy and distracting join/slice method.

$salt on the other hand is superfluous - that value is trivially calculated on the fly.

Makeshifts last the longest.


Comment on Re^2: Tact and the Monastery
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://198009]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2015-07-03 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls