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

Discussion in 'Perl Misc' started by Chris Olive, Jul 28, 2003.

  1. Chris Olive

    Chris Olive Guest

    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
    -----
    Chris Olive
    chris [at] technologEase [dot] com
    (pronounced "technologies")
    Chris Olive, Jul 28, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon
    Replies:
    5
    Views:
    11,158
    Scott M.
    Jan 17, 2010
  2. mh
    Replies:
    4
    Views:
    700
    Wolfgang Strobl
    May 31, 2005
  3. shailesh
    Replies:
    1
    Views:
    780
    Tim Golden
    Mar 28, 2007
  4. Ted Sung
    Replies:
    1
    Views:
    308
    Sherm Pendley
    Aug 30, 2004
  5. king
    Replies:
    1
    Views:
    277
Loading...

Share This Page