From 55e98190ab6057f82cfee6631198c4b759fd4f69 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 19 May 2003 13:16:19 +0000 Subject: simplify --- perl-install/standalone/lsnetdrake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/perl-install/standalone/lsnetdrake b/perl-install/standalone/lsnetdrake index f08008aa4..d6233209d 100755 --- a/perl-install/standalone/lsnetdrake +++ b/perl-install/standalone/lsnetdrake @@ -4,6 +4,7 @@ use lib qw(/usr/lib/libDrakX); use standalone; use network::nfs; use network::smb; +use MDK::Common::Func qw(if_); "@ARGV" =~ /-h/ and die "usage: lsnetdrake [-h] [--nfs] [--smb]\n"; @@ -13,11 +14,7 @@ my $smb = !@ARGV || "@ARGV" =~ /-(smb)/; $| = 1; $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; -my @l; -push @l, network::nfs->new if $nfs; -push @l, network::smb->new if $smb; - -foreach my $class (@l) { +foreach my $class (if_($nfs, network::nfs->new), if_($smb, network::smb->new)) { foreach my $server (sort_names($class->find_servers)) { foreach (sort_names(eval { $class->find_exports($server) })) { print $class->to_fullstring($_), "\n"; -- cgit v1.2.1