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

Hi there inmates, I've just installed ActivePerl v5.8.7 on an XP machine - eventually!! - and am trying to resolve some DNS names into IP addresses. I've lifted code straight out of one of the books that Dave Roth has written. This code uses Win32::AdminMisc but I can find no trace of this module on CPAN nor is ppm able to locate it. Has this module been deprecated or superseeded or have I just made a pigs ear of things? A test version of the lifted code follows :-
#!perl use Win32::AdminMisc ; # print "\n\tT E S T starts\n" ; if ($IP = Win32::AdminMisc::GetHostAddress('PC8627') ) { print "\n\tThe IP Add for PC8627 is $IP\n" ; } else { print "\n\tUnable to resolve the address!\n" ; } print "\n\tT E S T ends\n" ;

The error I get is :-
"Can't locate Win32/AdminMisc.pm in @INC. (@INC contains: C:\Perl\lib C:\Perl\site\lib) at C:\Perl\RC\test.pl line 2. etc

I've done some Perl on UNIX platforms but this is my first foray into the WIn32 world and am quite willing to believe that I've got the wrong end of the stick here. Any suggestions?

2006-10-18 Retitled by Corion, as per Monastery guidelines
Original title: 'Win32::AdminMisc'

Replies are listed 'Best First'.
Re: Where to find Win32::Adminmisc ?
by syphilis (Archbishop) on Oct 18, 2006 at 11:40 UTC
    If you download AdminMisc_5008.Zip from ftp://www.roth.net/pub/ntperl/adminmisc/20030714/bin/, extract that zip to some location, cd to that location, and run:

    ppm install Win32-AdminMisc.ppd

    it should work. (Did for me.)

    There's no doubt a way of doing it that avoids having to download that package from the ftp site ... but I'm damned if I could find it quickly. The stuff that Roth provides is worthy of much kudos ... but the way in which he makes it available is simply a pain in the arse.

    Cheers,
    Rob
      David Roth has instructions on installing his modules on his website - notice a the bottom of the page where you add his site as a ppm repository.
      http://www.roth.net/perl/packages/
      I've used several of his modules installed using these instructions and have never had any problems.
      Kudos to you as I managed to get it installed thanks to your instructions......it's still not working though!! I'm basically copying a script from WIN32 Perl Programming (P28) but there still appears to be a dll missing. I'll pose another question with full details as I'm now baffled - I never thought I'd say this but let me back to Perl on Solaris I know where to find things there! Thanks again.
Re: Where to find Win32::Adminmisc ?
by ldln (Pilgrim) on Oct 18, 2006 at 10:19 UTC
    I've had good experience with this module, so I have no idea why its not on CPAN.
    Anyway it's available at dave roths site.
      I've found Win32:AdminMisc on Dave Roth's site unfortunately I can't get ppm to look for it there! Whenever I try and add a repository to be searched by ppm I get an error "Unknown or ambiguous setting 'repository'. Do you know how to get round this? Thanks for the help, much appreciated. Cheers
        Whenever I try and add a repository to be searched by ppm I get an error "Unknown or ambiguous setting 'repository'. Do you know how to get round this?
        What exactly are you trying? Surely the fine manual has the correct syntaxt
Re: Where to find Win32::Adminmisc ?
by TheFluffyOne (Beadle) on Oct 18, 2006 at 10:43 UTC

    You don't need an external module to just lookup hostnames into IP addresses.

    If your hosts only resolve to a single address, you can use the following:

    #!/usr/bin/perl -w use Socket; my $hostname = "www.perlmonks.com"; my $ipAddress = inet_ntoa(inet_aton($hostname)); print "IP address of $hostname is $ipAddress.\n";
    Update: Just to clarify, by "external" module I mean one that's not included in the ActiveState distribution of Perl.