in reply to Re: Generating a random string of chars, easily.
in thread Generating a random string of chars, easily.

Oh my god, it's so clear once you saw it !
I keep forgeting about those shortcuts like the range operator, I was starting to write:
my @alpa =('a','b',...) ;
BTW isn't a int missing before the rand @alpha ?
I mean, it works without it but it seems strange no?
  • Comment on Re: Re: Generating a random string of chars, easily.

Replies are listed 'Best First'.
Re: Re: Re: Generating a random string of chars, easily.
by broquaint (Abbot) on Nov 14, 2002 at 15:45 UTC
    BTW isn't a int missing before the rand @alpha ?
    I mean, it works without it but it seems strange no?
    Since arrays indices are integer based, so perl automagically converts the given float to an int. I should imagine it would be rather awkward accessing the 2.53815239812875th element of an array ;)
    HTH

    _________
    broquaint

      I really like the word automagically, it really fits with perl. :)