services.cgi: avoid experimental warnings

Message ID 20230116203404.3723490-1-jon.murphy@ipfire.org
State Accepted
Commit 4941ce0031e9a9f699d0d9ff100f26a6bbce1654
Headers
Series services.cgi: avoid experimental warnings |

Commit Message

jon Jan. 16, 2023, 8:34 p.m. UTC
  - 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 <jon.murphy@ipfire.org>
---
 html/cgi-bin/services.cgi | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Bernhard Bitsch Jan. 16, 2023, 9:28 p.m. UTC | #1
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 <jon.murphy@ipfire.org>
> ---
>   html/cgi-bin/services.cgi | 1 +
>   1 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 @@
>   
>   use strict;
>   use feature "switch";
> +no warnings 'experimental';
Because the warnings originate from the switch statement only, we should 
be specific:

no warnings 'experimental:smartmatch';

>   # enable only the following on debugging purpose
>   #use warnings;
>   #use CGI::Carp 'fatalsToBrowser';
Further the line should be placed here. This creates the right sequence 
if the debugging mode is switched on ( by uncommenting these lines ).

Regards,
Bernhard
  
jon Jan. 17, 2023, 3:12 a.m. UTC | #2
Did the:  
> no warnings 'experimental:smartmatch’;
work A-OK?

Should this not be `no warnings ‘experimental:switch’;` ?

I don’t mind making the changes but I am doing this a little blind since I don’t do perl…

Jon

Jon Murphy
jon.murphy@ipfire.org



> On Jan 16, 2023, at 3:28 PM, Bernhard Bitsch <bbitsch@ipfire.org> 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 <jon.murphy@ipfire.org>
>> ---
>>  html/cgi-bin/services.cgi | 1 +
>>  1 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 @@
>>    use strict;
>>  use feature "switch";
>> +no warnings 'experimental';
> Because the warnings originate from the switch statement only, we should be specific:
> 
> no warnings 'experimental:smartmatch';
> 
>>  # enable only the following on debugging purpose
>>  #use warnings;
>>  #use CGI::Carp 'fatalsToBrowser';
> Further the line should be placed here. This creates the right sequence if the debugging mode is switched on ( by uncommenting these lines ).
> 
> Regards,
> Bernhard
  
Bernhard Bitsch Jan. 17, 2023, 1:33 p.m. UTC | #3
Hi,

Am 17.01.2023 um 04:12 schrieb jon:
> Did the:
>> no warnings 'experimental:smartmatch’;
> work A-OK?
> 

Sorry for the typo. The correct syntax is
   no warnings 'experimental::smartmatch';
I just tried it.

> Should this not be `no warnings ‘experimental:switch’;` ?
>

No.
As far as I've understood the docs, you can switch on the switch 
functionality with
use feature "switch";
The implementation of the 'when' sometimes uses the experimental 
smartmatch operator. Therefore the warnings have to be disabled.


> I don’t mind making the changes but I am doing this a little blind since 
> I don’t do perl…
> 
> Jon
>

Therefore others on the dev list can look on this. ;)

Bernhard

> Jon Murphy
> jon.murphy@ipfire.org <mailto:jon.murphy@ipfire.org>
> 
> 
> 
>> On Jan 16, 2023, at 3:28 PM, Bernhard Bitsch <bbitsch@ipfire.org 
>> <mailto:bbitsch@ipfire.org>> 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 <https://lists.ipfire.org/pipermail/development/2022-December/015113.html>
>>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org 
>>> <mailto:jon.murphy@ipfire.org>>
>>> ---
>>>  html/cgi-bin/services.cgi | 1 +
>>>  1 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 @@
>>>    use strict;
>>>  use feature "switch";
>>> +no warnings 'experimental';
>> Because the warnings originate from the switch statement only, we 
>> should be specific:
>>
>> no warnings 'experimental:smartmatch';
>>
>>>  # enable only the following on debugging purpose
>>>  #use warnings;
>>>  #use CGI::Carp 'fatalsToBrowser';
>> Further the line should be placed here. This creates the right 
>> sequence if the debugging mode is switched on ( by uncommenting these 
>> lines ).
>>
>> Regards,
>> Bernhard
>
  
jon Feb. 8, 2023, 3:29 a.m. UTC | #4
Peter,

Was this patch to be included in CU 173?

Jon


Jon Murphy
jon.murphy@ipfire.org



> On Jan 16, 2023, at 2:34 PM, Jon Murphy <jon.murphy@ipfire.org> wrote:
> 
> - 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 <jon.murphy@ipfire.org>
> ---
> html/cgi-bin/services.cgi | 1 +
> 1 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 @@
> 
> use strict;
> use feature "switch";
> +no warnings 'experimental';
> # enable only the following on debugging purpose
> #use warnings;
> #use CGI::Carp 'fatalsToBrowser';
> -- 
> 2.30.2
> 
>
  
Michael Tremer Feb. 9, 2023, 4:39 p.m. UTC | #5
Hello,

No, it doesn’t look like it:

  https://git.ipfire.org/?p=ipfire-2.x.git;a=history;f=html/cgi-bin/services.cgi;h=3c0f27f99ff72f9f96132787017f218ea79fbd1a;hb=HEAD

I will merge it into next. As it is only cosmetic, I will avoid rebuilding master for a little while. We will have to do this later on anyways.

-Michael

> On 8 Feb 2023, at 04:29, jon <jon.murphy@ipfire.org> wrote:
> 
> Peter,
> 
> Was this patch to be included in CU 173?
> 
> Jon
> 
> 
> Jon Murphy
> jon.murphy@ipfire.org
> 
> 
> 
>> On Jan 16, 2023, at 2:34 PM, Jon Murphy <jon.murphy@ipfire.org> wrote:
>> 
>> - 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 <jon.murphy@ipfire.org>
>> ---
>> html/cgi-bin/services.cgi | 1 +
>> 1 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 @@
>> 
>> use strict;
>> use feature "switch";
>> +no warnings 'experimental';
>> # enable only the following on debugging purpose
>> #use warnings;
>> #use CGI::Carp 'fatalsToBrowser';
>> -- 
>> 2.30.2
>> 
>> 
>
  

Patch

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 @@ 
 
 use strict;
 use feature "switch";
+no warnings 'experimental';
 # enable only the following on debugging purpose
 #use warnings;
 #use CGI::Carp 'fatalsToBrowser';