perl multithreading issue for autoincrement
- by user3446683
I'm writing a multi threaded perl script and storing the output in a csv file. I'm trying to insert a field called sl.no. in the csv file for each row entered but as I'm using threads, the sl. no. overlaps in most. Below is an idea of my code snippet.
for ( my $count = 1 ; $count <= 10 ; $count++ ) {
my $t = threads->new( \&sub1,…