Random selection back out of the DB shouldn't be that hard if you build the table correctly.
Use an ID feild that gives the order of insertion (i.e. first row inserted gets "0", next gets "1", etc.). Then populate an array with those values and randomize it using established methods. Your array might now look like:
50, 30, 98, 3, 6, 127, 42 ...
You can then do something like:
# @rand_array contains the randomized array
$sth = $dbh->prepare("SELECT data FROM my_table WHERE ID=?");
foreach $id (@rand_array) {
$sth->execute($id);
print $OUTFILE join('',$sth->fetchrow_array); #there will only be o
+ne element, no worries.
}
As long as you keep track of which ID's you create during your INSERT session, this will work smashingly. I also recommend issuing a CREATE TABLE at the start and a DROP TABLE at the end to ensure that you aren't duplicating once the file is written.
--
$me = rand($hacker{perl});
|