Skip to content

Commit 2bb418d

Browse files
committed
Convert a ternary to if-else blocks
Makes the code somewhat more readable.
1 parent 48a452f commit 2bb418d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/ExtUtils/MM_Win32.pm

+10-5
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,16 @@ sub init_tools {
142142
$self->{NOOP} ||= 'rem';
143143
$self->{DEV_NULL} ||= '> NUL';
144144

145-
$self->{FIXIN} ||= $self->{PERL_CORE} ?
146-
"\$(PERLRUN) -I$self->{PERL_SRC}\\cpan\\ExtUtils-PL2Bat\\lib $self->{PERL_SRC}\\win32\\bin\\pl2bat.pl" :
147-
-e "$Config{installscript}\\pl2bat.bat" ?
148-
qq{"$Config{installscript}\\pl2bat.bat"} :
149-
'pl2bat.bat';
145+
if (!$self->{FIXIN}) {
146+
if ($self->{PERL_CORE}) {
147+
my $psrc = $self->{PERL_SRC}; # shorten next line
148+
$self->{FIXIN} = "\$(PERLRUN) -I${psrc}\\cpan\\ExtUtils-PL2Bat\\lib ${psrc}\\win32\\bin\\pl2bat.pl";
149+
}
150+
else {
151+
my $p2bpath = "$Config{installscript}\\pl2bat.bat";
152+
$self->{FIXIN} = -e $p2bpath ? qq{"$p2bpath"} : 'pl2bat.bat';
153+
}
154+
}
150155

151156
$self->SUPER::init_tools;
152157

0 commit comments

Comments
 (0)