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

Is there any way to detect an open Internet connection and close it, in Windows Perl? There was a function in WININET.DLL that did this in C, but having looked at Win32::Internet, it doesn't export this. I've had a quick look at CPAN, but no module seems to cover this. Any help would be appreciated.
-- sub version { print "I cuss your capitalist pig tendencies bad!"; }

Replies are listed 'Best First'.
Re: Detecting Win32 internet connections
by $code or die (Deacon) on Aug 30, 2001 at 22:55 UTC
    I think that Win32::RASE is right up your street

    RasEnumConnections(), (RasHangUp() | HangUP()) look like the methods you'll need for this.

    $code or die

    Error: Keyboard not attached. Press F1 to continue.

    Update: If you know what functions you need in WININET.DLL, then you could use Win32::API to access those functions in perl.
Re: Detecting Win32 internet connections
by John M. Dlugosz (Monsignor) on Aug 30, 2001 at 23:01 UTC
    Use Win32::API to call the function in the winined.dll that the module seems to have forgotton.

    —John

Re: Detecting Win32 internet connections
by rrwo (Friar) on Aug 31, 2001 at 08:56 UTC

    Win32::API should allow you to call any DLL.