[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.424,1.425
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <kwi...@us...> - 2005-06-13 21:33:35
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17858/lib/Module/Build Modified Files: Base.pm Log Message: Memoize _default_INC Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.424 retrieving revision 1.425 diff -u -d -r1.424 -r1.425 --- Base.pm 13 Jun 2005 21:28:42 -0000 1.424 +++ Base.pm 13 Jun 2005 21:33:27 -0000 1.425 @@ -929,17 +929,21 @@ } # Determine the default @INC for this Perl -sub _default_INC { - my $self = shift; - - local $ENV{PERL5LIB}; # this is not considered part of the default. - - my $perl = ref($self) ? $self->perl : $self->find_perl_interpreter; - - my @inc = `$perl -le "print for \@INC"`; - chomp @inc; - - return @inc; +{ + my @default_inc; # Memoize + sub _default_INC { + my $self = shift; + return @default_inc if @default_inc; + + local $ENV{PERL5LIB}; # this is not considered part of the default. + + my $perl = ref($self) ? $self->perl : $self->find_perl_interpreter; + + my @inc = `$perl -le "print for \@INC"`; + chomp @inc; + + return @default_inc = @inc; + } } sub print_build_script { |