<?xml version="1.0" encoding="windows-1252"?>
<node id="1006766" title="Re: Pass a IO::Socket handle to a thread" created="2012-12-02 18:16:36" updated="2012-12-02 18:16:36">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;p&gt;Your problem is that you are trying to use perl as if it was C.

&lt;P&gt;This:&lt;code&gt;
sub protocol($srv) {
&lt;/code&gt;

&lt;p&gt;Does not declare a function that takes a single argument called &lt;c&gt;$srv&lt;/c&gt;.

&lt;p&gt;You need to learn how to use perl before you start playing with threads; otherwise you will just blame threading for your own mistakes. 

&lt;p&gt;You should start by reading [http://perldoc.perl.org/perlsub.html|perlsub] and writing some simple (non-threaded!) programs that use subroutines and pass arguments.

&lt;p&gt;Once you understand how to pass arguments and what "prototypes" are, you may be ready to progress to the next level.

&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;p align=right&gt; [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]&lt;/p&gt;&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;
</field>
<field name="root_node">
1006760</field>
<field name="parent_node">
1006760</field>
</data>
</node>
