in reply to Re^2: Problem in creating process
in thread Problem in creating process

Where do these hashes used in these subroutines come from? %hour_info, %system_id_info, %sub_data, %rej_data, %bcast_errcnt, %smsc_rej_data, %sms_sub_data, %del_data, %undel_data, %del_errcnt, %xp_data, %exp_errcnt etc.

I've probably missed a few and there are arrays as well.

Are they globals? What do you do with the data you've accumulated in them? Is the data accumulated and reset on a per file basis? Or accumulated across all the files of the given type?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: Problem in creating process
by ravi45722 (Pilgrim) on Nov 24, 2015 at 04:11 UTC

    Those are global. In that "some" hashes are used to upload to DB & all the hashes used to write an xlsx sheet

      Those are global. In that "some" hashes are used to upload to DB & all the hashes used to write an xlsx sheet

      So, presumably that post file-processing code runs where I've added comments below?

      foreach my $linkarray (1 .. 2) { $pm->start and next LINKS; # do the fork if ($first == 1) { my @cdr_list1 = `ls $cdr_directory/SMSBcastCDR_*_$bcat_cdrdate +\_*.log`; print "cdrs_file1 = @cdr_list1\n"; SMSBcastCDR(@cdr_list1); $first++; ## Update DB and produce xlsx sheet from global hashes + and arrays here???? } if ($first == 2) { my @smsc_cdr_list=`ls $smscdr_directory/SMSCDR_P*_$cdr +date*.log`; SMSCDR(@smsc_cdr_list); ## Update DB and produce xlsx sheet from global hashes + and arrays here???? } $pm->finish; # do the exit in the child process } $pm->wait_all_children;

      I have another suggestion: Instead of waiting for all your files to finish being written at midnight before starting your processing; run your process(es) to constantly monitor their respective directories throughout the day and process the files as they arrive.

      That way, when the final file arrives there'll only be a tiny amount of processing left to do and your stats will be available very shortly after.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.