summaryrefslogtreecommitdiffstats
path: root/perl-install/network/network.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
commitc2f200920f04dba0874c054038770a91a71fbba5 (patch)
tree7448485cea94afcd511535b592b1f061c543f3b9 /perl-install/network/network.pm
parent0a813b0ea3c7c30ca81e79b6303f5141e95fee4b (diff)
downloaddrakx-c2f200920f04dba0874c054038770a91a71fbba5.tar
drakx-c2f200920f04dba0874c054038770a91a71fbba5.tar.gz
drakx-c2f200920f04dba0874c054038770a91a71fbba5.tar.bz2
drakx-c2f200920f04dba0874c054038770a91a71fbba5.tar.xz
drakx-c2f200920f04dba0874c054038770a91a71fbba5.zip
use "if any" instead of "if grep", and various other occurences of "any", "every", "partition"
Diffstat (limited to 'perl-install/network/network.pm')
-rw-r--r--perl-install/network/network.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 888630b3d..bce84c86f 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -203,7 +203,7 @@ my $ip_regexp = qr/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
sub is_ip {
my ($ip) = @_;
my @fields = $ip =~ $ip_regexp or return;
- return if grep { $_ < 0 || $_ > 255 } @fields;
+ every { 0 <= $_ && $_ <= 255 } @fields or return;
@fields;
}
sub is_domain_name {
@@ -449,10 +449,10 @@ sub configureNetwork2 {
write_interface_conf("$etc/sysconfig/network-scripts/ifcfg-$_->{DEVICE}", $_, $prefix) foreach grep { $_->{DEVICE} } values %$intf;
add2hosts("$etc/hosts", $netc->{HOSTNAME}, map { $_->{IPADDR} } values %$intf);
- if (grep { $_->{BOOTPROTO} =~ /^(dhcp)$/ } values %$intf) {
+ if (any { $_->{BOOTPROTO} =~ /^(dhcp)$/ } values %$intf) {
$in->do_pkgs->install($netc->{dhcp_client} ? $netc->{dhcp_client} : 'dhcpcd');
}
- if (grep { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %$intf) {
+ if (any { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %$intf) {
$in->do_pkgs->install('pump');
}
#-res_init(); #- reinit the resolver so DNS changes take affect