diff options
author | Olivier Blin <oblin@mandriva.org> | 2004-08-11 14:51:43 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2004-08-11 14:51:43 +0000 |
commit | 8d62898c2bbb8d9039430f689a1387e2e201be0d (patch) | |
tree | 798733407b79030dd6fa348f7b902db6f0cc1097 | |
parent | e560f277e840a949e7c9535bb293b658e5a92d95 (diff) | |
download | drakx-8d62898c2bbb8d9039430f689a1387e2e201be0d.tar drakx-8d62898c2bbb8d9039430f689a1387e2e201be0d.tar.gz drakx-8d62898c2bbb8d9039430f689a1387e2e201be0d.tar.bz2 drakx-8d62898c2bbb8d9039430f689a1387e2e201be0d.tar.xz drakx-8d62898c2bbb8d9039430f689a1387e2e201be0d.zip |
use each_index
-rwxr-xr-x | perl-install/standalone/drakroam | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/perl-install/standalone/drakroam b/perl-install/standalone/drakroam index eab863caf..00a66425f 100755 --- a/perl-install/standalone/drakroam +++ b/perl-install/standalone/drakroam @@ -57,9 +57,7 @@ my %available_roaming_daemons = ( }, read_config => sub { my ($config) = @_; - my $line = 0; - foreach (cat_($config)) { - $line++; + each_index { if (/^#/) {} #ignore comments elsif (/^\n/) {} #ignore blank lines elsif (/([^ \t]+)([ \t]+)(.*)/) { @@ -80,8 +78,8 @@ my %available_roaming_daemons = ( else { $dhcp = 0 } &AddNet($essid, $mode, $channel, $key, $dhcp); } - else { die "Line $line of configuration file is not parseable.\n" } - } + else { die "Line $::i of configuration file is not parseable.\n" } + } cat_($config) }, write_config => sub { my ($config) = @_; |