From e729c5038f6af103f6fe0da2b3847dd7ba2fa85a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 24 Apr 2026 20:20:00 +0200 Subject: [PATCH] =?UTF-8?q?MT#61800=20perl:=20Switch=20code=20to=20=C2=ABu?= =?UTF-8?q?se=20v5.40=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will make available several new language features. Change-Id: Ief240a69747d54d6c16087a7ef14beb9033c1f4a --- helper/cat-yml | 3 +-- helper/del-value | 3 +-- helper/fileformat_version | 3 +-- helper/set-value | 3 +-- helper/sort-yml | 3 +-- helper/sync-db | 5 +++-- helper/tt2-process | 4 +--- helper/validate-yml | 3 +-- lib/NGCP/Template.pm | 3 +-- lib/NGCP/Template/Object.pm | 3 +-- lib/NGCP/Template/Plugin/Utils.pm | 3 +-- sbin/ngcp-network | 3 +-- sbin/ngcp-network-validator | 3 +-- sbin/ngcp-sync-db-creds | 5 +++-- sbin/ngcp-sync-db-grants | 5 +++-- testsuite/NGCP_Template_Object.t | 3 +-- 16 files changed, 22 insertions(+), 33 deletions(-) diff --git a/helper/cat-yml b/helper/cat-yml index b5ada3be..6646b50b 100755 --- a/helper/cat-yml +++ b/helper/cat-yml @@ -2,8 +2,7 @@ # Purpose: dump yaml configuration files ################################################################################ -use strict; -use warnings; +use v5.40; use YAML::XS; use Hash::Merge qw(merge); diff --git a/helper/del-value b/helper/del-value index c6e89f27..c483e792 100755 --- a/helper/del-value +++ b/helper/del-value @@ -1,7 +1,6 @@ #!/usr/bin/perl -wCSD -use strict; -use warnings; +use v5.40; use YAML::XS; use Scalar::Util qw(looks_like_number); diff --git a/helper/fileformat_version b/helper/fileformat_version index f61d1bf7..dc2fa677 100755 --- a/helper/fileformat_version +++ b/helper/fileformat_version @@ -2,8 +2,7 @@ # Purpose: report internal->fileformat setting of /etc/ngcp-config/config.yml ################################################################################ -use strict; -use warnings; +use v5.40; use YAML::XS; diff --git a/helper/set-value b/helper/set-value index 41476228..c898a9c4 100755 --- a/helper/set-value +++ b/helper/set-value @@ -1,7 +1,6 @@ #!/usr/bin/perl -wCSD -use strict; -use warnings; +use v5.40; use Safe; use YAML::XS; diff --git a/helper/sort-yml b/helper/sort-yml index dd269893..f333d254 100755 --- a/helper/sort-yml +++ b/helper/sort-yml @@ -2,8 +2,7 @@ # Purpose: sort yaml configuration file ################################################################################ -use strict; -use warnings; +use v5.40; use YAML::XS; diff --git a/helper/sync-db b/helper/sync-db index 070a4240..083e12d7 100755 --- a/helper/sync-db +++ b/helper/sync-db @@ -1,8 +1,9 @@ #!/usr/bin/perl -CSD # Purpose: template toolkit helper script ################################################################################ -use strict; -use warnings; + +use v5.40; + use English; use YAML::XS qw(LoadFile); use Hash::Merge qw(merge); diff --git a/helper/tt2-process b/helper/tt2-process index aa395df5..f94b17f4 100755 --- a/helper/tt2-process +++ b/helper/tt2-process @@ -1,8 +1,6 @@ #!/usr/bin/perl -use strict; -use warnings; -use feature qw(state); +use v5.40; use List::Util qw(any uniq pairmap); use Getopt::Long qw(:config posix_default bundling_values no_ignorecase); diff --git a/helper/validate-yml b/helper/validate-yml index dd3a4882..22b4efab 100755 --- a/helper/validate-yml +++ b/helper/validate-yml @@ -2,8 +2,7 @@ # Purpose: validate yml file format ################################################################################ -use strict; -use warnings; +use v5.40; use YAML::XS; use File::Temp qw/tempfile/; diff --git a/lib/NGCP/Template.pm b/lib/NGCP/Template.pm index e8ebf35f..3462887b 100644 --- a/lib/NGCP/Template.pm +++ b/lib/NGCP/Template.pm @@ -1,7 +1,6 @@ package NGCP::Template 1.000; -use strict; -use warnings; +use v5.40; use Carp; use NGCP::Template::Object; diff --git a/lib/NGCP/Template/Object.pm b/lib/NGCP/Template/Object.pm index 918217c6..f83177c5 100644 --- a/lib/NGCP/Template/Object.pm +++ b/lib/NGCP/Template/Object.pm @@ -1,7 +1,6 @@ package NGCP::Template::Object 1.000; -use strict; -use warnings; +use v5.40; use List::Util qw(any); diff --git a/lib/NGCP/Template/Plugin/Utils.pm b/lib/NGCP/Template/Plugin/Utils.pm index 3c40f07a..cf99fb01 100644 --- a/lib/NGCP/Template/Plugin/Utils.pm +++ b/lib/NGCP/Template/Plugin/Utils.pm @@ -1,7 +1,6 @@ package NGCP::Template::Plugin::Utils 1.000; -use strict; -use warnings; +use v5.40; use parent qw(Template::Plugin); diff --git a/sbin/ngcp-network b/sbin/ngcp-network index 0b39e95f..de1dffb2 100755 --- a/sbin/ngcp-network +++ b/sbin/ngcp-network @@ -1,7 +1,6 @@ #!/usr/bin/perl -CSD -use warnings; -use strict; +use v5.40; use Carp; use Data::Validate::IP; diff --git a/sbin/ngcp-network-validator b/sbin/ngcp-network-validator index 1298b9ec..965c4782 100755 --- a/sbin/ngcp-network-validator +++ b/sbin/ngcp-network-validator @@ -1,7 +1,6 @@ #!/usr/bin/perl -use strict; -use warnings; +use v5.40; use open qw(:std :encoding(UTF-8)); use Storable qw(dclone); diff --git a/sbin/ngcp-sync-db-creds b/sbin/ngcp-sync-db-creds index b3f5b617..1facc825 100755 --- a/sbin/ngcp-sync-db-creds +++ b/sbin/ngcp-sync-db-creds @@ -2,8 +2,9 @@ #---------------------------------------------------------------------- # Synchronizes passwords from constants.yml with MySQL #---------------------------------------------------------------------- -use strict; -use warnings; + +use v5.40; + use English qw( -no_match_vars ); use DBI qw(:sql_types); use Config::Tiny; diff --git a/sbin/ngcp-sync-db-grants b/sbin/ngcp-sync-db-grants index 97dffff0..fef9469d 100755 --- a/sbin/ngcp-sync-db-grants +++ b/sbin/ngcp-sync-db-grants @@ -2,8 +2,9 @@ #---------------------------------------------------------------------- # Synchronizes mysql grants from a schema template #---------------------------------------------------------------------- -use strict; -use warnings; + +use v5.40; + use English; use DBI; use Getopt::Long; diff --git a/testsuite/NGCP_Template_Object.t b/testsuite/NGCP_Template_Object.t index ea7e9e36..5d2e4f6a 100644 --- a/testsuite/NGCP_Template_Object.t +++ b/testsuite/NGCP_Template_Object.t @@ -1,7 +1,6 @@ #!/usr/bin/perl -use strict; -use warnings; +use v5.40; use Cwd; use Test::More;