Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Pass a IO::Socket handle to a thread

by BrowserUk (Pope)
on Dec 02, 2012 at 23:16 UTC ( #1006766=note: print w/replies, xml ) Need Help??

in reply to Pass a IO::Socket handle to a thread

Your problem is that you are trying to use perl as if it was C.


sub protocol($srv) {

Does not declare a function that takes a single argument called $srv.

You need to learn how to use perl before you start playing with threads; otherwise you will just blame threading for your own mistakes.

You should start by reading perlsub and writing some simple (non-threaded!) programs that use subroutines and pass arguments.

Once you understand how to pass arguments and what "prototypes" are, you may be ready to progress to the next level.

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.

RIP Neil Armstrong

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006766]
[erix]: ( TBH, I think it's a load of bull -- but maybe I'm mistaken )
[erix]: Hey that's Hungary - wave down ambrus and tell him to reboot his systems!
[choroba]: it might be a problem if you expect to reach the maximal possible value soon without squashing the ids
[erix]: that's really impossible with bigint
[erix]: and the site is still only 'hopefully' active :)
[erix]: but fair enough, he may think he solves a problem

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-06-23 15:48 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (551 votes). Check out past polls.