summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-02-26 12:04:45 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-02-26 12:04:45 +0000
commitfa05828b2d1402b86e197102182cb0529aeb78f9 (patch)
treef9095ed5834ff7bca70bf9b94f56bee5f9946791 /perl-install/common.pm
parent18d391650704782ddfc4661ad1022e2b60765d50 (diff)
downloaddrakx-backup-do-not-use-fa05828b2d1402b86e197102182cb0529aeb78f9.tar
drakx-backup-do-not-use-fa05828b2d1402b86e197102182cb0529aeb78f9.tar.gz
drakx-backup-do-not-use-fa05828b2d1402b86e197102182cb0529aeb78f9.tar.bz2
drakx-backup-do-not-use-fa05828b2d1402b86e197102182cb0529aeb78f9.tar.xz
drakx-backup-do-not-use-fa05828b2d1402b86e197102182cb0529aeb78f9.zip
(if_): fix for use in scalar context
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 3bf3c7e0f..ef141fe68 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -140,7 +140,9 @@ sub may_apply { $_[0] ? $_[0]->($_[1]) : (@_ > 2 ? $_[2] : $_[1]) }
sub if_($@) {
my $b = shift;
- $b ? @_ : ();
+ $b or return ();
+ wantarray || @_ <= 1 or die "if_ called in scalar context with more than one argument";
+ wantarray ? @_ : $_[0];
}
sub arch() {