in reply to Another Password Generator

$chars[int rand scalar @chars]
has two two many functions. Much more idiomatically written as:
$chars[rand @chars]

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: Another Password Generator
by Russ (Deacon) on May 09, 2000 at 02:54 UTC
    Yeah, that was a response to another suggestion I received before posting here. The feeling was to be clear about:
    1) This is an integer (for the index into @Chars)
    2) "What, exactly, does rand() do to an array argument?" Convert it to a scalar expression, of course, but the idea was for increased clarity...

    Thanks for the comment, it helps to hear learned opinions on the correct balance between idiom (succinctness) and explicitness (ease-of-grokking by the less experienced)

    Russ