develooper Front page | perl.perl5.porters | Postings from September 2009

Re: Make makedef.pl build the command line from its own @INC

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
September 24, 2009 23:47
Subject:
Re: Make makedef.pl build the command line from its own @INC
Message ID:
20090925084744.6c92e099@pc09.procura.nl
On Thu, 24 Sep 2009 22:03:25 +0200, Max Maischein <corion@corion.net>
wrote:

> -	# the Perl distro doesn't contain fancy filenames
> -	my $incs = join ' ', map {"-I$_"} @INC;
> -	my $cmd = "$^X $opts $incs -V";
> +	$ENV{PERL5LIB} = join $Config{path_sep}, @INC;
> +	my $cmd = "$^X $opts -V";
>  	my $config = `$cmd`;
> -	if (! defined $config) {

with the 'err' or 'dor' keyword in place we could have had

  my $config = `$cmd` err die "Couldn't run [$cmd]: $!";

instead of this

> +	if (! $config) {

now this change makes ugly code instead of simple

  my $config = `$cmd` or die "Couldn't run [$cmd]: $!";

what a pity

>  	    die "Couldn't run [$cmd]: $!";
>          };
>  	my($options) = $config =~ /^  Compile-time options: (.*?)\n^  \S/ms;

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About