Warnings on Win32::NetResouce::AddConnection() call to map drive...

C

Chris Olive

I'm using ActiveState's Win32::NetResource under W2K to map a drive in a
script. Works great except I'm getting warnings on the call
AddConnection() in that module, which I don't really care for. The call
uses a structure (hash ref) documented as a NETRESOURCE hash.

Looking at the NetResource.pm source at the offending line in the
warnings (line 339), every item in the hash is PACKed(). Not every item
in the hash is necessary for the Win32::NetReource::AddConnection() call
and in fact every example I have seen of this call DOES NOT have all the
hash elements initialized. So the warnings are BOGUS as far as I can
tell. When I give every element in the hash a default value, the call
fails, but when I call with just the elements it needs, the drive gets
mapped but I get warnings (from PACK() call in the NetResource.pm
source, trying to PACK() undef'd hash elements.)

Anyone have any luck calling this without turning off warnings before
the AddConnection() call? Just wondering. I guess that's why "no
warnings" exists, but I don't like using it. Doesn't seem "clean" to
me... I think AS made a mistake trying to universalize the NETRESOURCE
hash structure. AddConnection() obviously needs less and some of the
elements in the NETRESOURCE hash are informational or contextual which
are unneeded for AddConnection().

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top