sub new { my $class = shift; my $Path2Dll = shift; my $self = { # Dll function Path Function IN OUT _LocalAddr => _GetRefToDllFunction("$Path2Dll", 'AdsGetLocalAddress', 'P', 'N'), }; bless $self, $class; return $self } sub _GetRefToDllFunction { my $refToDllFunction = Win32::API->new(@_); if(not defined $refToDllFunction) { die "ERROR: Trying to load $_[1] from $_[0].dll. Failure: $!\n"; } return $refToDllFunction; }