Skip to content

Commit

Permalink
use UNIVERSAL::require, instead of require keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Rousse authored and Guillaume Rousse committed Jan 10, 2012
1 parent 9581ed0 commit a4ebd21
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lib/FusionInventory/Agent/Task/Inventory/Input/Generic/Screen.pm
Expand Up @@ -73,20 +73,26 @@ sub _getScreensFromWindows {

my $devices = {};
my $Registry;
eval {
require FusionInventory::Agent::Tools::Win32;
require Win32::TieRegistry;
Win32::TieRegistry->import(
Delimiter => '/',
ArrayValues => 0,
TiedRef => \$Registry
);
};

FusionInventory::Agent::Tools::Win32->require();
if ($EVAL_ERROR) {
print
"Failed to load FusionInventory::Agent::Tools::Win32: $EVAL_ERROR";
return;
}

Win32::TieRegistry->require();
if ($EVAL_ERROR) {
print "Failed to load Win32::OLE and Win32::TieRegistry\n";
print "Failed to load Win32::TieRegistry: $EVAL_ERROR";
return;
}

Win32::TieRegistry->import(
Delimiter => '/',
ArrayValues => 0,
TiedRef => \$Registry
);

use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;

Expand Down

0 comments on commit a4ebd21

Please sign in to comment.