in reply to General quesion

you'll hear it eventually and get burned by it soon, so here it is:

use strict and use warnings.
this will force you to declare all your variables. eventually, this will come in very handy. its better to get started early before you get seriously burned later on.
some other notes:

update (to Ovid): slowpoke. :)

Replies are listed 'Best First'.
RE: General question
by turnstep (Parson) on Aug 07, 2000 at 23:12 UTC

    > you don't have to call srand. perl will do this for you.

    Technically, only versions of perl 5.004 and higher will call srand for you. Also note that if you are using a pre-5.004 version, srand alone uses time as the seed, which is generally Not Very Random. It will probably do in this case. So calling srand explicitly is actually the safest, most portable way to do it. Or you could be really proper and call srand depending on the version of perl detected.

    Also, here is a simpler way to create a random string. Just has to use this one today, actually. (Yes, it's in the Perl Cookbook, but I came up with it on my own :p)

    @letters = ('A'..'Z','a'..'z',0..9,qw(! # $ % ^ | _)); $randomstring = join("", @letters[map {rand @letters} (1..8)]);