Win32::Wlan - Query wlan properties


    require Win32::Wlan;
    my $wlan = Win32::Wlan->new;
    if ($wlan->available) {
        print "Connected to ", $wlan->connection->{profile_name},"\n";
        print "I see the following networks\n";
        for ($wlan->visible_networks) {
            printf "%s\t-%d dbm\n", $_->{name}, $_->{signal_quality};

    } else {
        print "No Wlan detected (or switched off)\n";


Win32::Wlan->new( %args )

    my $wlan = Win32::Wlan->new();

Creates a new Win32::Wlan object.

  • available - optional argument to force detection of general Wlan availability

  • handle - optional argument to give an existing Wlan handle to the object

  • interface - optional argument to give an existing guuid to the object


Returns the Windows API handle for the Wlan API.


    print $wlan->interface->{name};

Returns a hashref describing the interface. The keys are guuid for the guuid, name for the human-readable name and status for the status of the interface.


        or warn "Wlan API is not available";

Returns whether the Wlan API is available. The Wlan API is available on Windows XP SP3 or higher.


        or warn "Wlan connection unavailable";

Returns whether a Wlan connection is established. No connection is established when Wlan is switched off or no access point is in range.


    if ($wlan->connected) {
        print "Connected to ";
        print $wlan->connection->{profile_name};

Returns information about the current connection in a hashref. The keys are

  • profile_name - the name of the profile of the current connection


Returns information about the currently visible networks as a list of hashrefs.

  • ssid - the SSID of the network

  • signal_quality - the signal quality ranging linearly from 0 to 100 meaning -100 dbm to -50 dbm


This module only supports the first wireless connection. If your machine has more than one wireless connection, you will need to use Win32::Wlan::API directly.

Currently, the module also has no way of determining whether Wlan gets switched on or off.


Win32::Wlan::API - the wrapper for the Windows API

Windows Native Wifi Reference


The public repository of this module is


The public support forum of this module is


Please report bugs in this module via the RT CPAN bug queue at or via mail to


Max Maischein


Copyright 2011-2011 by Max Maischein


This module is released under the same terms as Perl itself.