From mikedep333@gmail.com Mon Jan 5 14:29:19 2015 Received: (at 715) by bugs.x2go.org; 5 Jan 2015 13:29:20 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 2BBD05DB48 for <715@bugs.x2go.org>; Mon, 5 Jan 2015 14:29:19 +0100 (CET) Received: by mail-we0-f173.google.com with SMTP id q58so7858827wes.32 for <715@bugs.x2go.org>; Mon, 05 Jan 2015 05:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fCz0xKCr9hZyNSbXfloLz7J0lR0ChV0aVV67cBQaP04=; b=gA/1Q/s0jKaew1Xu5A6rhlsKFp1XO/b8KxoaMrG1w2b1VCHQam/H0EYQtnY764Vvum EFim2ye4QxQj/COPBXNoKVS98TGsSW+7THTpghJwmKHSes69JHj8iu0B6C1/jSDgbbqO vsSYwkm01h+ayMdsSU6BA9gVLL5cbgKwzWhJRD5H++KlEMQ+iznR5mJ/MuonNOYFQOPv 9vm1l44D3j8OCDvlCd+EqTeXcTwm1HKvtNGELQwvB6OiRSPX3axeWIEeNIRvniGc1C9C hEEFgLhBiLtvyrBKzNHETcDyUTy5gdK6+pRom7fBR28wy/Mr1SFyMfkr5mqbJi1ky3Lo Qayg== MIME-Version: 1.0 X-Received: by 10.194.23.6 with SMTP id i6mr121702015wjf.26.1420464558799; Mon, 05 Jan 2015 05:29:18 -0800 (PST) Received: by 10.180.90.116 with HTTP; Mon, 5 Jan 2015 05:29:18 -0800 (PST) In-Reply-To: <20150105101334.Horde.2WQ_Ieu5pzXhDeMONJTlrg1@mail.das-netzwerkteam.de> References: <20150105101334.Horde.2WQ_Ieu5pzXhDeMONJTlrg1@mail.das-netzwerkteam.de> Date: Mon, 5 Jan 2015 08:29:18 -0500 Message-ID: Subject: Re: [X2Go-Dev] Bug#715: Proposed patch From: Michael DePaulo To: Mike Gabriel Cc: 715@bugs.x2go.org Content-Type: text/plain; charset=UTF-8 Hi Mike#1, On Mon, Jan 5, 2015 at 5:13 AM, Mike Gabriel wrote: > Hi Michael, > > > On Mo 05 Jan 2015 05:12:04 CET, Michael DePaulo wrote: > >> Tags: patch >> >> I would like someone who knows Perl better, such as theUser2, to >> review this patch. >> >> Although this is a very small patch, theUser2 advised me to be careful >> when creating full paths. >> >> I tested it successfully under CentOS 5 and CentOS 6. >> >> I intended to use "make_path" instead of "mkpath" if File::Path 2.06 >> or later was detected. However, I could not figure out how to write a >> statement like "use File::Path( make_path)" if File::Path->VERSION is >> 2.06 or later. Specifically, it appears that "use" statements are >> executed at compile time in Perl, so they cannot be used within an if >> block. And I cannot just specify "use File::Path" for all versions of >> File::Path because "make_path" is not exported by default. >> >> EPEL 5: >> http://perldoc.perl.org/5.8.8/File/Path.html >> >> EPEL 6: >> http://perldoc.perl.org/5.10.1/File/Path.html >> >> Latest: >> http://perldoc.perl.org/File/Path.html > > > I recommend a more conditional approach testing the existence of the > make_path (and the mkpath) function during runtimed using the "defined" > command. > > See: > http://stackoverflow.com/questions/433752/how-can-i-determine-if-a-perl-function-exists-at-runtime > > Mike [...] I will follow that advice for runtime, but I still need to figure out what to do at compile time. http://perldoc.perl.org/functions/use.html "Because use takes effect at compile time, it doesn't respect the ordinary flow control of the code being compiled. In particular, putting a use inside the false branch of a conditional doesn't prevent it from being processed." -Mike#2