From 5ec52c56b184d4f1c9013b79d19ac012c86cd0ba Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 22 Jul 2005 03:09:50 +0000 Subject: add some comments, use meaningfull variable names --- perl-install/network/monitor.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/monitor.pm b/perl-install/network/monitor.pm index 3338a452d..27145ef9f 100644 --- a/perl-install/network/monitor.pm +++ b/perl-install/network/monitor.pm @@ -16,14 +16,17 @@ sub new { sub list_wireless { my ($o) = @_; - my $networks; - eval { $networks = $o->call_method('ScanResults') }; + my $results; + eval { $results = $o->call_method('ScanResults') }; my %networks; - while ($networks =~ /^((?:[0-9a-f]{2}:){5}[0-9a-f]{2})\t(\d+)\t(\d+)\t(.*?)\t(.*)$/mg) { + #- bssid / frequency / signal level / flags / ssid + while ($results =~ /^((?:[0-9a-f]{2}:){5}[0-9a-f]{2})\t(\d+)\t(\d+)\t(.*?)\t(.*)$/mg) { $networks{$1} = { frequency => $2, signal_level => $3, flags => $4, ssid => $5 }; } - eval { $networks = $o->call_method('ListNetworks') }; - while ($networks =~ /^(\d+)\t(.*?)\t(.*?)\t(.*)$/mg) { + my $list; + eval { $list = $o->call_method('ListNetworks') }; + #- network id / ssid / bssid / flags + while ($list =~ /^(\d+)\t(.*?)\t(.*?)\t(.*)$/mg) { if (my $net = $networks{$3} || find { $_->{ssid} eq $2 } values(%networks)) { $net->{id} = $1; $net->{ssid} ||= $2; -- cgit v1.2.1