Negi Sushil wrote:
> Hello All,
>
> I am getting an unhandled exception sporadically while executing my
> Perl DLL
>
> Error Number: 0x0
> Description: Bad arg length for Socket::inet_ntoa, length is 0,
> should be 4 at CreateIP.pl line 248.
>
> the line 248 is
>
> local $ret =
>
&createsetRegKeyValue("HKEY_LOCAL_MACHINE","SYSTEM\\CurrentControlSet\\M
achineIP",
> "MachineIP", "REG_SZ", inet_ntoa(inet_aton(Win32::NodeName())),
> @_[0]);
My first thouth is that inet_aton is not returning what inet_ntoa is
expecting, possibly undef. See 'perldoc Socket' for more info.
Also:
"local $ret" should probably be "my $ret", which is how you
declare a variable to have local scope.
Do not use & when calling a subroutine unless you know what it
does.
@_[0] doesn't do what you might think it does. It might be O.K.
in this context, but might surprise
you in others. I expect that this should be $_[0].
>
> intrestingly the IP address is successfully set in the registry.
Perhaps it is already set, or something else is setting it ?
HTH
--
Brian Raven
-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely
for the intended addressee(s). Unauthorised reproduction, disclosure,
modification, and/or distribution of this email may be unlawful. If you
have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary
companies.
-----------------------------------------------------------------------
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs