Enable strict and warnings and Perl itself will tell you that this is wrong:

my $thread = threads->create(\$self->_openFDCObject($swObject,$switch) +)

threads->create() requires a code reference as its first argument and you are passing a reference to the return value of a method call. (Which given that the method returns a list of two items, means I cannot actually guess what it is that you are passing to create(), but I do know you ought to be seeing an error message of the form:Thread 1 terminated abnormally: Not a CODE reference)

But before we get into how you might correct the syntax and semantics issues, why are you trying to run that method in a thread? How long does it take to create this new FosDataCapture() object?

Let me tell you that your threading "design" will not (ever) work as is, and for so many reasons that it is hard to know where to start. Your understanding of threads is either so limited or wrong that I really don't know how to begin to help you. But if you answer the above question first, we might get some where


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".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: How do I used a threaded subroutine inside a perl object by BrowserUk
in thread How do I used a threaded subroutine inside a perl object by adamcpfeiffer

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.