in reply to Re^3: Can't locate object method ""
in thread Can't locate object method ""

There are only two file handles used in the code. One in the input thread, and one in the output thread (the one that "terminated abnormally"). Both are declared with "my" in the thread's subroutine. Based on the arguments used when the crash happened, the only lines that use the file handle in the output thread are:

my $fh; open($fh,'>',$output) or fail("Failed to read $output",$!); binmode($fh); my $csv; $csv = Text::CSV_XS->new ({ binary => 1, eol => $outputeol, sep_char = +> $outputdelim, quote_char => $outputenc, escape_char => $outputesc } +) or fail("Failed to create output CSV object",Text::CSV->error_diag +()); while(1) { my $th = $q->dequeue; last unless(defined $th); my $chunk = $th->join(); foreach my $outputs(@$chunk) { $csv->print($fh,$outputs); } } close($fh);

Replies are listed 'Best First'.
Re^5: Can't locate object method ""
by kennethk (Abbot) on Dec 06, 2016 at 00:44 UTC
    There are a couple of ways that you could get a message about IO::File with no nearby file handle; for example, an accidental reference to ARGV instead of @ARGV can cause it. Would seem unlikely, though.

    It really sounds like it should be in the thread, or somehow something really hinky in threads itself.


    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.