in reply to generating random blocks of data...

#!/usr/bin/perl my $size=int(rand(8192)+8192); my @array=(a..z,A..Z,0..9); while($size--){ print $array[rand(@array)]; }
This will do it... it's pretty random just prints out anywhere from 8 to 16k worth of random characters... from @array. If you have any further constraints for the type of data let us know.

Tim Vroom | vroom | vroom@cs.hope.edu

Replies are listed 'Best First'.
RE: RE: generating random blocks of data...
by Anonymous Monk on Feb 25, 2000 at 04:15 UTC

    One important thing left out here is to make sure that you use srand. If you don't, the block will be the same every time you run the program.

      Actually, perl is smarter than that. rand will call srand for you if you don't do it.

      michael
      the blue haired monk

Re: RE: generating random blocks of data...
by meonkeys (Chaplain) on Nov 08, 2001 at 10:18 UTC
    Just one small change, quotes around the letters.
    my @array=('a'..'z','A'..'Z',0..9);


    -- "A Jedi uses the Force for knowledge and defense, never for attack."