I need help with an example in "Network Programming With Perl" by Lincoln Stein. Here's a snipet of the code for the IO::SessionSet Module:
package IO::SessionSet
use strict;
use Carp;
use IO::Handle;
use IO::SessionData;
use vars '$DEGUG';
$DEBUG = 0;
sub new {
my $pack = shift;
my $listen = shift;
sub new {
my $self = bless {
sessions => {},
readers => IO::Select->new(),
writers => IO::Select->new(),
}, $pack;
if (defined($listen) and $listen->can('accept') {
$self->{listen_socket} = $listen;
$self->{readers}->add($listen);
}
return $self;
}
I can't find anything in this example which has $listen->can('accept'), where is he pulling this method from? Thanks.