Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
May 1, 2007, 12:37 am
rate this thread
On 1 May 2007 09:59:06 -0700,
It is mainly an IO::Select object, i.e. you use it in accordance with
the IO::Select documentation, generally by calling methods on it.
It is also a reference blessed into the IO::Select class, but that's
just the way perl implements OO.
What it is a reference to (and that may very well be an array, but more
commonly a hash is used) is not important, unless you have to modify the
code of IO::Select itself. Actually, I just checked, and IO::Select
objects are indeed references to arrays, but again, it doesn't matter.
One of the points of OO classes is to encapsulate and hide the
implementation from the user of the class. It should never be necessary
to need to know what exactly underlies the implementation.
If you want to know, however, a quick look at the code is often the best
way to find out. I used perldoc -m IO::Select to check.
Martien Verbruggen | Blessed are the Fundamentalists, for they
| shall inhibit the earth.
Actually, to me, at this stage of understanding, it kind of does
matter that it's an array. While it could have been an array, a list,
or a hash, those structures are at least familiar and I know means
exist for traipsing through them. So now the statement @ready = $sel-
In practice, I won't need to refresh myself with the underlying
mechanisms, but they are important to learn from.
So this is what I've got from all this so far: IO::Select allows me to
'peruse', if you will, all the connections associated with a port I
designate in a client-server connection, upon or through which I've
established a communications socket (bear with me if this is rambling
a bit). Somewhere in the system, something is keeping track of all
the connections I establish through that port, and IO::Select helps me
look at them all.
How's that so far?
- » Re: FAQ 4.51 How do I permute N elements of a list?
- — Previous thread in » PERL Discussions