Thank you for your reply, zentara.

Ah, this is my dilemma. I get profoundly odd, inconsistent behavior.

First, here's a successful run with the forking code commented out:

C:\>perl CountFilesRecords.pl ABCD\???\Z* ExportVolumeFolder,TotalDATRecords,TotalTextFiles,TotalLFPRecords,Tota +lImageFiles ABCD/001/Z000003014V001,6,6,88,88 ABCD/002/Z000003015V001,66,66,201,201 ABCD/003/Z000003079V001,1,1,27,27 ABCD/004/Z000003080V001,1,1,32767,32767 ABCD/005/Z000003081V001,1,1,14297,14297 ABCD/006/Z000002503V001,9,9,45,45 ABCD/007/Z000002780V001,2106,2106,2907,2907 ABCD/008/Z000003020V001,49,49,51,51 ABCD/009/Z000003021V001,5,5,6,6 ABCD/010/Z000003069V001,2851,2851,4576,4576 ABCD/011/Z000003071V001,1259,1259,3242,3242 ABCD/012/Z000005594V001,439,439,708,708 ABCD/013/Z000003140V001,1,1,25,25 ABCD/014/Z000003141V001,1,1,275,275 ABCD/015/Z000003142V001,2,2,14,14 ABCD/016/Z000003143V001,1,1,36,36 ABCD/017/Z000003144V001,10,10,316,316 ABCD/018/Z000003145V001,2,2,835,835 C:\>

Now, here's a sequence of runs, one immediately after the other, with the forking code restored:

C:\>perl CountFilesRecords.pl ABCD\???\Z* ExportVolumeFolder,TotalDATRecords,TotalTextFiles,TotalLFPRecords,Tota +lImageFiles ABCD/001/Z000003014V001,6,,88, ABCD/005/Z000003081V001,1,,14297, ABCD/004/Z000003080V001,1,1,32767,32767 C:\>perl CountFilesRecords.pl ABCD\???\Z* ExportVolumeFolder,TotalDATRecords,TotalTextFiles,TotalLFPRecords,Tota +lImageFiles ABCD/004/Z000003080V001,1,1,32767,32767 C:\>perl CountFilesRecords.pl ABCD\???\Z* ExportVolumeFolder,TotalDATRecords,TotalTextFiles,TotalLFPRecords,Tota +lImageFiles ABCD/002/Z000003015V001,-1,,201,201 ABCD/003/Z000003079V001,1,1,,27 ABCD/001/Z000003014V001,6,6,88,88 ABCD/006/Z000002503V001,9,9,45,45 ABCD/008/Z000003020V001,-1,49,51,51 ABCD/009/Z000003021V001,5,5,6,6 ABCD/007/Z000002780V001,2106,2106,2907,2907 ABCD/011/Z000003071V001,1259,1259,,3242 ABCD/012/Z000005594V001,439,439,,708 Error from open(IO::Handle=GLOB(0x2acc2e8), <&STDIN): Bad file descrip +tor at C:/Perl64/site/lib/Capture/Tiny.pm line 99 Capture::Tiny::_open('IO::Handle=GLOB(0x2acc2e8)', '<&STDIN') +called at C:/Perl64/site/lib/Capture/Tiny.pm line 176 Capture::Tiny::_copy_std() called at C:/Perl64/site/lib/Captur +e/Tiny.pm line 346 Capture::Tiny::_capture_tee(1, 0, 0, 0, 'CODE(0x2a1e7a8)') cal +led at CountFilesRecords.pl line 113 main::probe_volume('HASH(0x2962728)') called at CountFilesReco +rds.pl line 99 ABCD/004/Z000003080V001,1,,32767, C:\>perl CountFilesRecords.pl ABCD\???\Z* ExportVolumeFolder,TotalDATRecords,TotalTextFiles,TotalLFPRecords,Tota +lImageFiles ABCD/001/Z000003014V001,6,6,88,88

You can plainly see the bizarre, inconsistent output from one run to the next. The last run stalled. In fact, it's still running as I type this, neither finishing nor producing more output.

This is why I'd hoped some kind brother on PerlMonks—one who has much more experience using Parallel::ForkManager than I do—might look at this script and immediately recognize what's wrong with it.


In reply to Re^2: Adding parallel processing to a working Perl script by Jim
in thread Adding parallel processing to a working Perl script by Jim

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.