I just looked at the NetResource module and they are all just straight
functions.  Your format:

my $rc = Win32::NetResource::AddConnection( { 
          RemoteName => "\\\\DTS_SERVER2\\E\$" } );

is similar to what you would do with an object-method based module such as
Win32:Perms.  There you must create objects with the form you use:

my $perm_object = new Win32::Perms("\\\\foo\bar");

However, for the NetResource module, this is not the expected execution.
The AddConnection function doesn't create an object or anything, it just
adds the connection you ask it to.  It returns a value of 0 for failure or 1
for success, which is why $rc = 1.

-Mike

__________________________________________
Michael Marziani
Systems Administrator - OnFiber Communications
Phone: 512.651.7455     Fax: 512.651.7327


-----Original Message-----
From: Shea, Linchi [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 4:37 PM
To: [EMAIL PROTECTED]
Subject: Win32::NetResource::AddConnection


In the following code segment, $rc is always set to 1 even when I have
removed the share from the server.

my $rc = Win32::NetResource::AddConnection( { 
          RemoteName => "\\\\DTS_SERVER2\\E\$" } );
print "$rc\n";

Is this a known issue with AddConnection for ActivePerl 5.005_003 Binary
build 522?

Linchi 

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to