in reply to work around for static vars and singleton constructors not inheriting properly?
and later, in a script:package MyClass; use strict; use vars qw/@ISA/; use Exporter; @ISA = qw/Exporter/; sub new { my $class = shift; my $self = {}; bless $self, $class; }
for more information take a look at#!/usr/bin/perl -w use strict; use MyClass; my ($d1, $d2) = (MyClass->new, MyClass->new); ...
perldoc perlbot perldoc perltoot perldoc -f bless
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: work around for static vars and singleton constructors not inheriting properly?
by simonm (Vicar) on Jul 18, 2005 at 16:00 UTC |