Skip to content

Instantly share code, notes, and snippets.

@VladimirSaz
Created May 6, 2014 06:30
Show Gist options
  • Save VladimirSaz/11554390 to your computer and use it in GitHub Desktop.
Save VladimirSaz/11554390 to your computer and use it in GitHub Desktop.
PERL - overload class implement
sub new
{
my $class = shift;
my %params = @_;
#
#some code here
#
my $self = $class->SUPER::new(%params);
$class = ref $class if ref $class;
bless $self, $class;
return $self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment