Re: Pop Quiz

2002-01-28 Thread Casey West
On Mon, Jan 28, 2002 at 02:35:10PM -0500, Nikola Janceski wrote: :Can the indented code below be written better (fewer lines or easier/better :algorithm)? Yep. :srand(time ^ $$); # i don't care about the seed In recent versions of Perl (5.005* and up, I think), you don't need to call srand().

Pop Quiz

2002-01-28 Thread Nikola Janceski
Can the indented code below be written better (fewer lines or easier/better algorithm)? srand(time ^ $$); # i don't care about the seed $words = "Removes a random letter"; $randnum = int( rand( length($words) ) ); # always an interger number one less than the length # this was the only