Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Idealy I would like to beable to create the object using a normal constructor like I normaly would and straight away beable to straight away use like a filehandle
http://www.engelschall.com/~sb/download/pkg/Tie-Handle-3.0.README
from the information at the above url I assumed that the following should work:
and then in the main packge:package Listen; require Tie::Handle; @ISA = qw(Tie::Handle); use strict; use warnings; use IO::Socket::INET; sub new { #constructor my $class = shift; my $self = {}; bless $self; $self->tie(new IO::Socket::INET(Listen => 1, LocalPort => 1863, Re +useAddr => 1)); return $self; } 1;
However this doesnt seem to work. I have also tried various other things, to no avail.use listen; my $test = new Listen;
Any advice would be greatly appriciated,
Alan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tie and Tie::Handle
by kschwab (Vicar) on Jul 18, 2002 at 03:30 UTC | |
by fembot (Initiate) on Jul 19, 2002 at 17:32 UTC | |
|
Re: Tie and Tie::Handle
by Russ (Deacon) on Jul 18, 2002 at 00:26 UTC |