There's a couple of things I'd change:
package Log;
my $instance = undef;
sub new {
shift;
unless ($instance){
$instance={};
bless $instance,"Log";
}
return $instasnce;
}
You would not need the
get_log_instance sub since
| handwaving here
my $log=new Log();
|
would either return the instance in play already or create a new one it there wasn't one in play. Creating a singleton is something I do all the time. Especially for my logging module. :-)
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg