From owner-freebsd-perl@freebsd.org Mon Oct 2 22:50:40 2017 Return-Path: Delivered-To: freebsd-perl@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E685EE29515 for ; Mon, 2 Oct 2017 22:50:40 +0000 (UTC) (envelope-from tobez@tobez.org) Received: from heechee.tobez.org (heechee.tobez.org [IPv6:2001:2010:1::feef]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1E6D7E6AF for ; Mon, 2 Oct 2017 22:50:40 +0000 (UTC) (envelope-from tobez@tobez.org) Received: from [127.0.0.1] (heechee.tobez.org [194.255.56.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by heechee.tobez.org (Postfix) with ESMTPSA id B0CFA4B3FD; Tue, 3 Oct 2017 00:50:37 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Weird issue with PERL hashes on FreeBSD with EasyTimeline.pl that does not occur on RHEL 7.2 From: Anton Berezin In-Reply-To: <789ab286c78d90e4077033fb589f3d29@infogalactic.com> Date: Tue, 3 Oct 2017 00:50:37 +0200 Cc: freebsd-perl@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <789ab286c78d90e4077033fb589f3d29@infogalactic.com> To: crew@infogalactic.com X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-perl@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: maintainer of a number of perl-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 22:50:41 -0000 Hello, > On 2 Oct 2017, at 21:08, Crew = wrote: >=20 > An issue has turned up, seemingly with PERL hashes on FreeBSD = 10.3-STABLE and 10.3-RELEASE-p21. >=20 > It involves a PERL script called EasyTimeline.pl. I have a simple = reproducer that involves running EasyTimeline.pl with some ,input data = (but you also need ploticus installed.) >=20 > When run on those two versions of FreeBSD the script will fail = something like one out of five to seven times, but on RHEL 7.2 it never = fails. On FreeBSD it will often fail the first time it is run, and then = will succeed for the next five or so attempts and then fail again. >=20 > It seems to relate to one key in a hash being a proper prefix of = another and the order in which the keys are in the hash. In this case = the keys are "grid" and "gridcolor=E2=80=9D. In Perl, one cannot rely on any particular order while iterating a hash, = so if something further down the line expects things to be in certain = order, the script has to be modified to supply the correct order. This has really nothing to do with FreeBSD. Most likely it has = something to do with the version of perl on those two platforms (which = you have not specified), since, if I remember correctly, the order of = hash keys during iteration (or the invocation of the =E2=80=9Ckeys=E2=80=9D= operator) has been deliberately randomized in the more recent versions = of perl interpreter. Finally, there is =E2=80=9Cperl=E2=80=9D the interpreter, and =E2=80=9CPer= l=E2=80=9D the language. There is no =E2=80=9CPERL=E2=80=9D. This is = important to some people. Hope this helps, \Anton.=