From owner-cvs-all Tue Feb 20 6:21:48 2001 Delivered-To: cvs-all@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.189]) by hub.freebsd.org (Postfix) with SMTP id 0CC4737B65D for ; Tue, 20 Feb 2001 06:21:38 -0800 (PST) (envelope-from roam@ringworld.nanolink.com) Received: (qmail 48117 invoked by uid 1000); 20 Feb 2001 14:19:43 -0000 Date: Tue, 20 Feb 2001 16:19:43 +0200 From: Peter Pentchev To: Dag-Erling Smorgrav Cc: Neil Blakey-Milner , Tony Finch , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: ports/Tools/scripts/mkptools mkpbuild mkpinstall Message-ID: <20010220161943.B47687@ringworld.oblivion.bg> Mail-Followup-To: Dag-Erling Smorgrav , Neil Blakey-Milner , Tony Finch , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200101031116.f03BGlq39072@freefall.freebsd.org> <20010103141000.B54743@ringworld.oblivion.bg> <20010103142157.D54743@ringworld.oblivion.bg> <20010220152313.A47687@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Tue, Feb 20, 2001 at 02:48:02PM +0100 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Feb 20, 2001 at 02:48:02PM +0100, Dag-Erling Smorgrav wrote: > Peter Pentchev writes: > > +my $path_tmp = "/tmp"; > > +eval { > > + require 'paths.ph'; > > + $path_tmp = &_PATH_TMP; > > +}; > > There's no point in using eval if you're not going to handle the case > where the 'require' fails. Either remove the eval { } or, add some > sort of error handling (conditional on $@ being defined). I just want the thing not to die when the require fails, e.g. paths.ph is not there. The 'error handling' has already been done higher up - $path_tmp is initialized to a fall-back value of "/tmp". G'luck, Peter -- I had to translate this sentence into English because I could not read the original Sanskrit. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message