From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernhard Bitsch To: development@lists.ipfire.org Subject: Re: [PATCH] services.cgi: avoid experimental warnings Date: Tue, 17 Jan 2023 14:33:09 +0100 Message-ID: <6e8b8e45-c29c-f7e5-e293-300bc8381161@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6860968884088253874==" List-Id: --===============6860968884088253874== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, Am 17.01.2023 um 04:12 schrieb jon: > Did the: >> no warnings 'experimental:smartmatch=E2=80=99; > work A-OK? >=20 Sorry for the typo. The correct syntax is no warnings 'experimental::smartmatch'; I just tried it. > Should this not be `no warnings =E2=80=98experimental:switch=E2=80=99;` ? > No. As far as I've understood the docs, you can switch on the switch=20 functionality with use feature "switch"; The implementation of the 'when' sometimes uses the experimental=20 smartmatch operator. Therefore the warnings have to be disabled. > I don=E2=80=99t mind making the changes but I am doing this a little blind = since=20 > I don=E2=80=99t do perl=E2=80=A6 >=20 > Jon > Therefore others on the dev list can look on this. ;) Bernhard > Jon Murphy > jon.murphy(a)ipfire.org >=20 >=20 >=20 >> On Jan 16, 2023, at 3:28 PM, Bernhard Bitsch > > wrote: >> >> Hi, >> >> just a little annotation after reading the Perl docs. >> >> Am 16.01.2023 um 21:34 schrieb Jon Murphy: >>> - add single line to code: no warnings 'experimental'; >>> - corrects this issue: >>> https://lists.ipfire.org/pipermail/development/2022-December/015113.html = >>> Signed-off-by: Jon Murphy >> > >>> --- >>> =C2=A0html/cgi-bin/services.cgi | 1 + >>> =C2=A01 file changed, 1 insertion(+) >>> diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi >>> index 3c0f27f99..0d06ab5fe 100644 >>> --- a/html/cgi-bin/services.cgi >>> +++ b/html/cgi-bin/services.cgi >>> @@ -21,6 +21,7 @@ >>> =C2=A0=C2=A0=C2=A0use strict; >>> =C2=A0use feature "switch"; >>> +no warnings 'experimental'; >> Because the warnings originate from the switch statement only, we=20 >> should be specific: >> >> no warnings 'experimental:smartmatch'; >> >>> =C2=A0# enable only the following on debugging purpose >>> =C2=A0#use warnings; >>> =C2=A0#use CGI::Carp 'fatalsToBrowser'; >> Further the line should be placed here. This creates the right=20 >> sequence if the debugging mode is switched on ( by uncommenting these=20 >> lines ). >> >> Regards, >> Bernhard >=20 --===============6860968884088253874==--