use Config;
use threads;

$Config{useithreads} or die "Recompile Perl with threads to run this program\n";

if ( $Config{useithreads} ) {
  printf("THREADED\n");
} else {
  printf("NOT threaded\n");
}

$thr1=threads->new(&sub1);
$thr2=threads->new(&sub2);

# clean up the threads
$thr1->detach; 
$thr2->detach; 

exit(0);

###### SUBROUTINES #########
sub sub1 {
printf("made it to sub1\n");
system("cscript open_test.vbs 1");
}

sub sub2 {
printf("made it to sub2\n");
system("cscript open_test.vbs 2");
}