No problem!
Received an update from Tomasz with a better way. Per Tomasz: "non-anonymous subroutine definitions in perl are being executed in compile time, which means the subs will be created even when the condition in your if is false. That means they can conflict with the future versions of Win32::Daemon."
Better solution provided by Tomasz, which works for me:
use Win32::Daemon;
# restore AUTOLOAD sub which was erroneiously removed in 20181025 vers
+ion of Win32::Daemon
# note that newer versions of Win32::Daemon don't use AUTOLOAD at all
if ($Win32::Daemon::VERSION == 20181025) {
package Win32::Daemon;
*Win32::Daemon::AUTOLOAD = sub {
no strict;
no warnings;
# This AUTOLOAD is used to 'autoload' constants from the const
+ant()
# XS function. If a constant is not found then control is pas
+sed
# to the AUTOLOAD in AutoLoader.
my( $Constant ) = $AUTOLOAD;
my( $Result, $Value );
$Constant =~ s/.*:://;
$Result = Constant( $Constant, $Value );
if( 0 == $Result )
{
# The extension could not resolve the constant...
$AutoLoader::AUTOLOAD = $AUTOLOAD;
goto &AutoLoader::AUTOLOAD;
return;
}
elsif( 1 == $Result )
{
# $Result == 1 if the constant is valid but not defined
# that is, the extension knows that the constant exists bu
+t for
# some wild reason it was not compiled with it.
$pack = 0;
($pack,$file,$line) = caller;
print "Your vendor has not defined 'Win32::Daemon' macro $
+constname, used in $file at line $line.";
}
elsif( 2 == $Result )
{
# If $Result == 2 then we have a string value
$Value = "'$Value'";
}
# If $Result == 3 then we have a numeric value
eval "sub $AUTOLOAD { return( $Value ); }";
goto &$AUTOLOAD;
}
}
|