Skip to content

Commit

Permalink
Don't try absolute path twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Leont committed Oct 21, 2012
1 parent 6340d6d commit d447276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Revision history for Devel-FindPerl

{{$NEXT}}
Cache the results of find_perl_interpreter
Don't try absolute path twice

0.005 2012-10-06 00:14:49 Europe/Amsterdam
Explicitly load File::Basename
Expand Down
10 changes: 3 additions & 7 deletions lib/Devel/FindPerl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ sub _discover_perl_interpreter {
my @potential_perls;

# Try 1, Check $^X for absolute path
push @potential_perls, $perl if File::Spec->file_name_is_absolute($perl);
push @potential_perls, File::Spec->file_name_is_absolute($perl) ? $perl : File::Spec->rel2abs($perl);

# Try 2, Check $^X for a valid relative path
my $abs_perl = File::Spec->rel2abs($perl);
push @potential_perls, $abs_perl;

# Try 3, Last ditch effort: These two option use hackery to try to locate
# Try 2, Last ditch effort: These two option use hackery to try to locate
# a suitable perl. The hack varies depending on whether we are running
# from an installed perl or an uninstalled perl in the perl source dist.
if ($ENV{PERL_CORE}) {
Expand All @@ -51,7 +47,7 @@ sub _discover_perl_interpreter {

}
else {
# Try 3.B, First look in $Config{perlpath}, then search the user's
# Try 2.B, First look in $Config{perlpath}, then search the user's
# PATH. We do not want to do either if we are running from an
# uninstalled perl in a perl source tree.

Expand Down

0 comments on commit d447276

Please sign in to comment.