From 3e296ab8515cf7186c263d9fe52e24c53d3260d6 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 21 Apr 2005 13:33:05 +0000 Subject: (ConnectNow) simplify --- perl-install/standalone/drakroam | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'perl-install') diff --git a/perl-install/standalone/drakroam b/perl-install/standalone/drakroam index d8f360b7b..eed78b96d 100755 --- a/perl-install/standalone/drakroam +++ b/perl-install/standalone/drakroam @@ -356,9 +356,7 @@ sub ConnectNow { my @command = ""; push @command, "$IWConfig $device essid $KnownList->{data}[$row][0] "; my %commands = (1 => 'mode', 2 => 'channel', 4 => 'key'); - foreach (my ($key, $cmd) = each %commands) { - push @command, "$cmd $KnownList->{data}[$row][$key] " if $KnownList->{data}[$row][$key]; - } + push @command, map { "$commands{$_} $KnownList->{data}[$row][$_] " } grep { $KnownList->{data}[$row][$_] } keys %commands; push @command, "; "; if ($KnownList->{data}[$row][3]) { push @command, "$IFConfig $device up; $DHClient $device"; -- cgit v1.2.1