Um, you obtain $CONSOLE at the top of your code and "share" it via closure(*) with the thread routine.
And in your thread routine you use $CONSOLE...once. Then, for no apparent reason, you switch to using $threadCONSOLE which is never declared or initialised.
And despite your post showing use strict; at the top, when I try syntax checking it, I get:
C:\test>perl -c 632320.pl
Global symbol "$i" requires explicit package name at 632320.pl line 17
+.
Global symbol "$i" requires explicit package name at 632320.pl line 17
+.
Global symbol "$i" requires explicit package name at 632320.pl line 17
+.
Global symbol "$i" requires explicit package name at 632320.pl line 18
+.
Global symbol "$i" requires explicit package name at 632320.pl line 22
+.
Global symbol "$i" requires explicit package name at 632320.pl line 22
+.
Global symbol "$i" requires explicit package name at 632320.pl line 22
+.
Global symbol "$i" requires explicit package name at 632320.pl line 23
+.
Global symbol "$i" requires explicit package name at 632320.pl line 24
+.
Global symbol "$i" requires explicit package name at 632320.pl line 24
+.
Global symbol "$i" requires explicit package name at 632320.pl line 25
+.
Global symbol "$i" requires explicit package name at 632320.pl line 34
+.
Global symbol "$i" requires explicit package name at 632320.pl line 34
+.
Global symbol "$i" requires explicit package name at 632320.pl line 34
+.
Global symbol "$i" requires explicit package name at 632320.pl line 35
+.
Global symbol "$inPattQty" requires explicit package name at 632320.pl
+ line 69.
Global symbol "$outPattQty" requires explicit package name at 632320.p
+l line 69.
syntax error at 632320.pl line 73, near ") {"
632320.pl has too many errors.
Update: hacking my way past all the errors and warnings, your code seems to run:
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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|