diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/common.pm | 4 |
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() { |