Gentoo Archives: gentoo-perl

From: Michael Cummings <mcummings@g.o>
To: gentoo-perl@l.g.o
Subject: Re: [gentoo-perl] g-cpan.pl
Date: Thu, 12 May 2005 12:11:43
Message-Id: 200505120811.48868.mcummings@gentoo.org
In Reply to: [gentoo-perl] g-cpan.pl by "David (Sniper) Rigaudiere"
1 On Wednesday 11 May 2005 09:56 pm, David (Sniper) Rigaudiere wrote:
2 > - get rid of \t, and use of 4 spaces as perlstyle :)
3 heh
4 > - get rid of system(mv ...) use File::Copy::move()
5 agreed
6 >
7 > # FIXME Sniper
8 > # the defined() seems mistakes, we want the defined status or ENV values
9
10 Ah, but when you run this code and the env var isn't defined - you get a
11 broken script that dies on an undeclared var (a la strict and warnings). I
12 added the defines to keep it from choking for those of us that don't have
13 ENV{TMPDIR,ftp_proxy,http_proxy} set. These are the vars portage and cpan use
14 if defined - but if not defined, they don't care - but when trying to set
15 values (and under use strict) we need someway of dealing with them not even
16 existing (vs undef). One of those undef != non-exist - because undef is a
17 value in itself, and in this case the values simply don't exist to test.
18
19 > ??? my $tmp_dir = -d $ENV{TMPDIR} ? defined($ENV{TMPDIR}) :
20 > $ENV{HOME};
21 > my $ftp_proxy = $ENV{ftp_proxy} ? defined($ENV{ftp_proxy}) : '';
22 > my $http_proxy = $ENV{http_proxy} ? defined($ENV{http_proxy}) : '';
23 > my $user_shell = -x $ENV{SHELL} ? defined($ENV{SHELL}) :
24 > DEF_BASH_PROG;
25 >
26 >
27 >
28 >
29 > David "Sniper" Rigaudiere
30 > GPG KeyID 0xFF1E982D
31
32 --
33
34 -----o()o---------------------------------------------
35 Michael Cummings | #gentoo-dev, #gentoo-perl
36 Gentoo Perl Dev | on irc.freenode.net
37 -----o()o---------------------------------------------

Replies

Subject Author
Réf. : Re: [gentoo-perl] g-cpan.pl antoine.raillon@××××.com