#! perl -slw use strict; ## Decide a sync point if first instance ## or use the supplied sync time otherwise my $time = $ARGV[ 1 ] || time() +2 ; ## Ensure "recursion" stops. $ARGV[ 0 ]--; ## "Recursively" start asynchronous copies of ourself. system qq[start cmd /c $0 $ARGV[ 0 ] $time ] if $ARGV[ 0 ] > 0; ## Wait until sync time to give other copies a chance to get going. select undef, undef, undef, 0.1 until time() > $time; for( 1 .. 1000 ) { open FH, '>> :raw', 'data/append.tst' or die $!; syswrite FH, "$$\t$_\n"; close FH; ## Slow things a little so that the don't all comeout together. select undef, undef, undef, 0.001; }