sub new{ my ($class,$logpath) = @_; unless ( ref $singleton eq 'Log' ) { $singleton = {}; bless( $singleton, $class ); $singleton->create_path($logpath); } return $singleton; } #### package Log; my $instance = undef; sub new { shift; unless ($instance){ $instance={}; bless $instance,"Log"; } return $instasnce; } #### | handwaving here my $log=new Log(); |