CarolinaPerler has asked for the wisdom of the Perl Monks concerning the following question:
We're hoping @arrayOfHashes would contain an array of groups on the machine. It doesn't and we get an error "The specified procedure could not be found." I initially thought there was something wrong with Win32::Lanman or how we were using it. So, I wrote a little test like these:----------------- unless (Win32::Lanman::NetLocalGroupEnum('', \@arrayOfHashes)) { my $error = Win32::FormatMessage Win32::Lanman::GetLastError; $error = Win32::Lanman::GetLastError if ($error eq ""); throw Error::Simple($error); } -----------------
and----------------- package getGroups; use strict; use Win32::Lanman; sub getGroupsViaLanman { my $arrayRef = shift; if (Win32::Lanman::NetLocalGroupEnum('', $arrayRef)){ print "Package Array: " . Dumper($arrayRef) . "\n"; return $arrayRef; } else { my $error = Win32::Lanman::GetLastError(); print "ERROR: failed to get groups via Win32::Lanman::NetLocalGro +upsEnum ---> " . Win32::FormatMessage Win32::Lanman::GetLastError() +. "\n"; exit; } } 1; -----------------
That works. So, Win32::Lanman and the general approach to using it work. Ergo, we must be doing something in our larger application that is stepping on something that Win32::Lanman is using.----------------- #!perl use strict; use getGroups; my @results; getGroups::getGroupsViaLanman(\@results); use Data::Dumper; print "GROUPS: " . Dumper(@results) . "\n"; -----------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strategy to track failure...
by BrowserUk (Patriarch) on Jun 13, 2013 at 14:49 UTC | |
by toolic (Bishop) on Jun 13, 2013 at 15:15 UTC | |
by CarolinaPerler (Acolyte) on Jun 13, 2013 at 18:20 UTC | |
|
Re: Strategy to track failure...
by LanX (Saint) on Jun 13, 2013 at 14:52 UTC | |
by choroba (Cardinal) on Jun 13, 2013 at 14:57 UTC |