#!/usr/bin/perl

use warnings;

# Generate a log-like file

#make it run in the background
setpriority 0, 0, 10;

#make it output to the console with a high priority (so that it doesn't come out intermittantly
select(STDOUT);
$| = 1;

# this is our has string although it could be anything here
$a = "0123456789abcdef";
# this is the data string to simulate the, well, data
$b = "asdlkuerhnbilseurhlcnmawolawulnmoawcmhlowerlnuhnawesmowxamcgfuigenruvhnrileuhmxoluawikeugrcnukwyegbxukawynkbywkwxyngwkinwyenikgfkwiagfikawyxikfywangefikawyngekfiaxyenkiawynifawyngfikwenxigfwenytbjyjerrreertert";

#open the file to write to.
open (LOG, ">my_data.file");
        #loop a million times to create a million lines
        foreach $x (1..1000000) {
                #start of by creating the first data part
                $z = "";
                # 16 characters long
                foreach (1..16) {
                        #add the new character to the end of the existing string
                        $z .= substr($a, int(rand 16), 1);
                }
                #add a space and then a random 100-long piece of 'data'
                $z .= " ".(substr ($b, int(rand 100), 100))."\n";
                #output it to the 'log' file
                print LOG $z;
                #let the user know that something is still happening by printint out a dot
                #   every 1000th time throught he loop.
                if (($x / 1000) == int($x / 1000)) {print "."}
        }
close (LOG);

print "\n";
