brayk1990 has asked for the wisdom of the Perl Monks concerning the following question:

A while ago I posted on here asking for help with authenicating into a server. The method I was presented with at that time work well for the time being. However, I have now started to run into more errors with this method, and it has in fact been failing at times. Currently I am using this to authenticate into the server.
qx|net use \\\\$server\\C\$\\VoiceGenie\\mp\\log $ServerPassword /use +r:$username|; find( \&finddata, "\\\\$server\\c\$\\VoiceGenie\\mp\\logs\\" ) or warn + "Could not enter the specified path \\\\$server\\c\$\\VoiceGenie\\mp +\\logs\\.\n"; #Function that allows the use of File::Find. qx|net use \\\\$server\\C\$\\VoiceGenie\\mp\\log /D|;
The code I have that goes threw the file structure to locate the files works properly, as I have tested it on the my local system with no errors. I just have been having troubles reliably getting connected with remote servers so that I can traverse their files structure and open the log files I need to search. Any help would be greatly appreciated. Thank you. **Update: The errors I am recieving are initially a system error 55, this occurs even when the connection has been properly established and the code operates correctly. This is accompanied by an explanation of the error stating "The specified network resource or device is no longer available." Next The warn statement I have created displays. Along with another statement: "the network connection could not be found." This is not a warning that I have created.

Replies are listed 'Best First'.
Re: Windows Server Authentication
by marto (Cardinal) on May 02, 2012 at 14:54 UTC

    The net command will tell you why it failed. Alter your code to ensure it has completed correctly, and to alert you of failures, at which point your program shouldn't progress further. You've not posted any errors messages experienced.

Re: Windows Server Authentication
by dasgar (Priest) on May 02, 2012 at 15:30 UTC

    Based on the error messages, I'd double-check that you have the correct path, credentials and that your system is resolving the server name to the correct IP address.

    Although I have not personally used this module, it looks like Win32::FileOp can be used to map a drive and allows for you to specify a username and password to use when mapping the drive.

      That module does look as though it could potentially work. However, due to limitations where I work, I am unable to install modules onto my system. So any method I use would have to come from the modules that are contained with in the initial install of Active State perl.
Re: Windows Server Authentication
by marto (Cardinal) on May 02, 2012 at 15:32 UTC

    These errors come from the use of net use not Perl. See system error codes, each one you list is in here.

    Update: s/commands/errors/