Skip to content

Instantly share code, notes, and snippets.

@stevelippert
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save stevelippert/9470084 to your computer and use it in GitHub Desktop.

Select an option

Save stevelippert/9470084 to your computer and use it in GitHub Desktop.
A simple 'worker' script that write to a log every RAND seconds.
#!/usr/local/bin/perl
my $outputFile = '/home/steve/test.log';
while (1){
my $sleepTime = int( rand( 120 ) );
open my $fh, '>>', $outputFile;
print $fh $$." - ".localtime." sleeping for: ".$sleepTime."\n";
close $fh;
sleep( $sleepTime );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment