summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/lsnetdrake7
1 files 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";