diff --git a/.github/workflows/exercises.yml b/.github/workflows/exercises.yml index 844696b7..0769d24b 100644 --- a/.github/workflows/exercises.yml +++ b/.github/workflows/exercises.yml @@ -8,11 +8,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ['ubuntu-22.04', 'macos-12'] - perl: ['5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.26', '5.24', '5.22', '5.20'] + os: ['ubuntu-latest', 'macos-latest'] + perl: ['5.40', '5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.26', '5.24', '5.22', '5.20'] + distribution: ['default'] include: - - os: 'windows-2022' - perl: '5.32' + - os: 'windows-latest' + perl: '5.38' + distribution: strawberry name: Perl ${{ matrix.perl }} on ${{ matrix.os }} steps: @@ -20,12 +22,12 @@ jobs: uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: Set up perl - uses: shogo82148/actions-setup-perl@28eae78d12c2bba1163aec45d123f6d9228bc307 + uses: shogo82148/actions-setup-perl@87c3ad5232e6c1b59da33bfde4fb24b0482901f1 with: perl-version: ${{ matrix.perl }} - distribution: strawberry + distribution: ${{ matrix.distribution }} - - run: cpm install -g Test2::V0 + - run: cpm install -g Test2::V0 UUID - name: Exercise modules shell: pwsh diff --git a/cpanfile b/cpanfile index 8dd4f68e..ace466d3 100644 --- a/cpanfile +++ b/cpanfile @@ -1,4 +1,5 @@ requires 'lib::gitroot'; +requires 'Data::Dmp'; requires 'Moo'; requires 'namespace::autoclean'; requires 'Path::Tiny'; @@ -6,5 +7,5 @@ requires 'Perl::Tidy'; requires 'Template::Mustache'; requires 'Test2::V0'; requires 'TOML::Parser'; +requires 'UUID'; requires 'YAML'; -requires 'Data::Dmp'; diff --git a/exercises/concept/booking-up-for-beauty/.meta/BookingUpForBeauty.pm b/exercises/concept/booking-up-for-beauty/.meta/BookingUpForBeauty.pm index b4aa997a..515e35be 100644 --- a/exercises/concept/booking-up-for-beauty/.meta/BookingUpForBeauty.pm +++ b/exercises/concept/booking-up-for-beauty/.meta/BookingUpForBeauty.pm @@ -1,6 +1,6 @@ package BookingUpForBeauty; -use v5.38; +use v5.40; use Time::Piece; #use Const::Fast; diff --git a/exercises/concept/booking-up-for-beauty/lib/BookingUpForBeauty.pm b/exercises/concept/booking-up-for-beauty/lib/BookingUpForBeauty.pm index bdc7ec0c..d3495343 100644 --- a/exercises/concept/booking-up-for-beauty/lib/BookingUpForBeauty.pm +++ b/exercises/concept/booking-up-for-beauty/lib/BookingUpForBeauty.pm @@ -1,6 +1,6 @@ package BookingUpForBeauty; -use v5.38; +use v5.40; # Suggested datetime modules you can use: #use Time::Piece; diff --git a/exercises/concept/high-score-board/.meta/HighScoreBoard.pm b/exercises/concept/high-score-board/.meta/HighScoreBoard.pm index fbe44672..0e42c4d9 100644 --- a/exercises/concept/high-score-board/.meta/HighScoreBoard.pm +++ b/exercises/concept/high-score-board/.meta/HighScoreBoard.pm @@ -1,6 +1,6 @@ package HighScoreBoard; -use v5.38; +use v5.40; our %Scores; diff --git a/exercises/concept/high-score-board/lib/HighScoreBoard.pm b/exercises/concept/high-score-board/lib/HighScoreBoard.pm index 6be7c2bc..d2d19e64 100644 --- a/exercises/concept/high-score-board/lib/HighScoreBoard.pm +++ b/exercises/concept/high-score-board/lib/HighScoreBoard.pm @@ -1,6 +1,6 @@ package HighScoreBoard; -use v5.38; +use v5.40; our %Scores; diff --git a/exercises/concept/inventory-management/.meta/InventoryManagement.pm b/exercises/concept/inventory-management/.meta/InventoryManagement.pm index 7f493cda..e1873e25 100644 --- a/exercises/concept/inventory-management/.meta/InventoryManagement.pm +++ b/exercises/concept/inventory-management/.meta/InventoryManagement.pm @@ -1,6 +1,6 @@ package InventoryManagement; -use v5.38; +use v5.40; sub create_inventory ($items) { my %inventory; diff --git a/exercises/concept/inventory-management/lib/InventoryManagement.pm b/exercises/concept/inventory-management/lib/InventoryManagement.pm index a39f8e61..a6d60fbf 100644 --- a/exercises/concept/inventory-management/lib/InventoryManagement.pm +++ b/exercises/concept/inventory-management/lib/InventoryManagement.pm @@ -1,6 +1,6 @@ package InventoryManagement; -use v5.38; +use v5.40; sub create_inventory ($items) { my %inventory; diff --git a/exercises/concept/language-list/.meta/LanguageList.pm b/exercises/concept/language-list/.meta/LanguageList.pm index 6b87f628..dfa536e1 100644 --- a/exercises/concept/language-list/.meta/LanguageList.pm +++ b/exercises/concept/language-list/.meta/LanguageList.pm @@ -1,6 +1,6 @@ package LanguageList; -use v5.38; +use v5.40; use List::Util qw; our @Languages; diff --git a/exercises/concept/language-list/lib/LanguageList.pm b/exercises/concept/language-list/lib/LanguageList.pm index 130ada42..d4dbf89a 100644 --- a/exercises/concept/language-list/lib/LanguageList.pm +++ b/exercises/concept/language-list/lib/LanguageList.pm @@ -1,6 +1,6 @@ package LanguageList; -use v5.38; +use v5.40; our @Languages; diff --git a/exercises/concept/lasagna/.meta/Lasagna.pm b/exercises/concept/lasagna/.meta/Lasagna.pm index 0627d5d3..5c444100 100644 --- a/exercises/concept/lasagna/.meta/Lasagna.pm +++ b/exercises/concept/lasagna/.meta/Lasagna.pm @@ -1,6 +1,6 @@ package Lasagna; -use v5.38; +use v5.40; our $ExpectedMinutesInOven = 40; diff --git a/exercises/concept/lasagna/lib/Lasagna.pm b/exercises/concept/lasagna/lib/Lasagna.pm index 79e4b704..70ab35c9 100644 --- a/exercises/concept/lasagna/lib/Lasagna.pm +++ b/exercises/concept/lasagna/lib/Lasagna.pm @@ -1,6 +1,6 @@ package Lasagna; -use v5.38; +use v5.40; our $ExpectedMinutesInOven = undef; diff --git a/exercises/practice/accumulate/lib/Accumulate.pm b/exercises/practice/accumulate/lib/Accumulate.pm index 930edcb5..e34dd761 100644 --- a/exercises/practice/accumulate/lib/Accumulate.pm +++ b/exercises/practice/accumulate/lib/Accumulate.pm @@ -1,6 +1,6 @@ package Accumulate; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/all-your-base/lib/AllYourBase.pm b/exercises/practice/all-your-base/lib/AllYourBase.pm index 3d69ef68..7f162a6d 100644 --- a/exercises/practice/all-your-base/lib/AllYourBase.pm +++ b/exercises/practice/all-your-base/lib/AllYourBase.pm @@ -1,6 +1,6 @@ package AllYourBase; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/allergies/lib/Allergies.pm b/exercises/practice/allergies/lib/Allergies.pm index 195aef76..37513e30 100644 --- a/exercises/practice/allergies/lib/Allergies.pm +++ b/exercises/practice/allergies/lib/Allergies.pm @@ -1,6 +1,6 @@ package Allergies; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/anagram/lib/Anagram.pm b/exercises/practice/anagram/lib/Anagram.pm index a606d7a8..1711ab8d 100644 --- a/exercises/practice/anagram/lib/Anagram.pm +++ b/exercises/practice/anagram/lib/Anagram.pm @@ -1,6 +1,6 @@ package Anagram; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/atbash-cipher/lib/AtbashCipher.pm b/exercises/practice/atbash-cipher/lib/AtbashCipher.pm index 4016c96c..a10967be 100644 --- a/exercises/practice/atbash-cipher/lib/AtbashCipher.pm +++ b/exercises/practice/atbash-cipher/lib/AtbashCipher.pm @@ -1,6 +1,6 @@ package AtbashCipher; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/binary-search-tree/lib/BinarySearchTree.pm b/exercises/practice/binary-search-tree/lib/BinarySearchTree.pm index 8e90db22..82ffae47 100644 --- a/exercises/practice/binary-search-tree/lib/BinarySearchTree.pm +++ b/exercises/practice/binary-search-tree/lib/BinarySearchTree.pm @@ -1,6 +1,6 @@ package BinarySearchTree; -use v5.38; +use v5.40; use Moo; package BinarySearchTree::Node { diff --git a/exercises/practice/binary-search/lib/BinarySearch.pm b/exercises/practice/binary-search/lib/BinarySearch.pm index 6ccc8704..14e7054b 100644 --- a/exercises/practice/binary-search/lib/BinarySearch.pm +++ b/exercises/practice/binary-search/lib/BinarySearch.pm @@ -1,6 +1,6 @@ package BinarySearch; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/bob/lib/Bob.pm b/exercises/practice/bob/lib/Bob.pm index 7724d327..ae1dea81 100644 --- a/exercises/practice/bob/lib/Bob.pm +++ b/exercises/practice/bob/lib/Bob.pm @@ -1,7 +1,7 @@ # Declare package 'Bob' package Bob; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/bottle-song/lib/BottleSong.pm b/exercises/practice/bottle-song/lib/BottleSong.pm index 3457c1f3..323f51be 100644 --- a/exercises/practice/bottle-song/lib/BottleSong.pm +++ b/exercises/practice/bottle-song/lib/BottleSong.pm @@ -1,6 +1,6 @@ package BottleSong; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/clock/lib/Clock.pm b/exercises/practice/clock/lib/Clock.pm index 15145332..b46a6ba8 100644 --- a/exercises/practice/clock/lib/Clock.pm +++ b/exercises/practice/clock/lib/Clock.pm @@ -1,6 +1,6 @@ package Clock; -use v5.38; +use v5.40; use Moo; # rwp = read-write protected diff --git a/exercises/practice/clock/t/clock.t b/exercises/practice/clock/t/clock.t index a1bef347..cbeb6682 100755 --- a/exercises/practice/clock/t/clock.t +++ b/exercises/practice/clock/t/clock.t @@ -274,7 +274,7 @@ $todo = undef; # end: 6f8c6541-afac-4a92-b0c2-b10d4e50269f $todo = todo 'experimental feature' if Clock->new( hour => 0, minute => 0 ) =~ /OBJECT/; # begin: bb9d5a68-e324-4bf5-a75e-0e9b1f97a90d is( - Clock->new( hour => 17, minute => 3 ), + Clock->new( hour => 17, minute => 3 ), Clock->new( hour => -31, minute => 3 ), "Compare two clocks for equality: clocks with negative hour that wraps", ); @@ -282,7 +282,7 @@ $todo = undef; # end: bb9d5a68-e324-4bf5-a75e-0e9b1f97a90d $todo = todo 'experimental feature' if Clock->new( hour => 0, minute => 0 ) =~ /OBJECT/; # begin: 56c0326d-565b-4d19-a26f-63b3205778b7 is( - Clock->new( hour => 13, minute => 49 ), + Clock->new( hour => 13, minute => 49 ), Clock->new( hour => -83, minute => 49 ), "Compare two clocks for equality: clocks with negative hour that wraps multiple times", ); @@ -306,7 +306,7 @@ $todo = undef; # end: 533a3dc5-59a7-491b-b728-a7a34fe325de $todo = todo 'experimental feature' if Clock->new( hour => 0, minute => 0 ) =~ /OBJECT/; # begin: fff49e15-f7b7-4692-a204-0f6052d62636 is( - Clock->new( hour => 2, minute => 40 ), + Clock->new( hour => 2, minute => 40 ), Clock->new( hour => 3, minute => -20 ), "Compare two clocks for equality: clocks with negative minute", ); @@ -314,7 +314,7 @@ $todo = undef; # end: fff49e15-f7b7-4692-a204-0f6052d62636 $todo = todo 'experimental feature' if Clock->new( hour => 0, minute => 0 ) =~ /OBJECT/; # begin: 605c65bb-21bd-43eb-8f04-878edf508366 is( - Clock->new( hour => 4, minute => 10 ), + Clock->new( hour => 4, minute => 10 ), Clock->new( hour => 5, minute => -1490 ), "Compare two clocks for equality: clocks with negative minute that wraps", ); @@ -322,7 +322,7 @@ $todo = undef; # end: 605c65bb-21bd-43eb-8f04-878edf508366 $todo = todo 'experimental feature' if Clock->new( hour => 0, minute => 0 ) =~ /OBJECT/; # begin: b87e64ed-212a-4335-91fd-56da8421d077 is( - Clock->new( hour => 6, minute => 15 ), + Clock->new( hour => 6, minute => 15 ), Clock->new( hour => 6, minute => -4305 ), "Compare two clocks for equality: clocks with negative minute that wraps multiple times", ); @@ -330,7 +330,7 @@ $todo = undef; # end: b87e64ed-212a-4335-91fd-56da8421d077 $todo = todo 'experimental feature' if Clock->new( hour => 0, minute => 0 ) =~ /OBJECT/; # begin: 822fbf26-1f3b-4b13-b9bf-c914816b53dd is( - Clock->new( hour => 7, minute => 32 ), + Clock->new( hour => 7, minute => 32 ), Clock->new( hour => -12, minute => -268 ), "Compare two clocks for equality: clocks with negative hours and minutes", ); @@ -338,7 +338,7 @@ $todo = undef; # end: 822fbf26-1f3b-4b13-b9bf-c914816b53dd $todo = todo 'experimental feature' if Clock->new( hour => 0, minute => 0 ) =~ /OBJECT/; # begin: e787bccd-cf58-4a1d-841c-ff80eaaccfaa is( - Clock->new( hour => 18, minute => 7 ), + Clock->new( hour => 18, minute => 7 ), Clock->new( hour => -54, minute => -11513 ), "Compare two clocks for equality: clocks with negative hours and minutes that wrap", ); diff --git a/exercises/practice/crypto-square/lib/CryptoSquare.pm b/exercises/practice/crypto-square/lib/CryptoSquare.pm index d79dfa3d..6b3e0f2d 100644 --- a/exercises/practice/crypto-square/lib/CryptoSquare.pm +++ b/exercises/practice/crypto-square/lib/CryptoSquare.pm @@ -1,6 +1,6 @@ package CryptoSquare; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/custom-set/lib/CustomSet.pm b/exercises/practice/custom-set/lib/CustomSet.pm index c20d7332..e9a859da 100644 --- a/exercises/practice/custom-set/lib/CustomSet.pm +++ b/exercises/practice/custom-set/lib/CustomSet.pm @@ -1,6 +1,6 @@ package CustomSet; -use v5.38; +use v5.40; use Moo; has elements => ( diff --git a/exercises/practice/darts/lib/Darts.pm b/exercises/practice/darts/lib/Darts.pm index 0196d680..5ecd193b 100644 --- a/exercises/practice/darts/lib/Darts.pm +++ b/exercises/practice/darts/lib/Darts.pm @@ -1,6 +1,6 @@ package Darts; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/difference-of-squares/lib/DifferenceOfSquares.pm b/exercises/practice/difference-of-squares/lib/DifferenceOfSquares.pm index c4b100c4..479a7543 100644 --- a/exercises/practice/difference-of-squares/lib/DifferenceOfSquares.pm +++ b/exercises/practice/difference-of-squares/lib/DifferenceOfSquares.pm @@ -1,6 +1,6 @@ package DifferenceOfSquares; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/etl/lib/ETL.pm b/exercises/practice/etl/lib/ETL.pm index 9c18937f..fab9e10a 100644 --- a/exercises/practice/etl/lib/ETL.pm +++ b/exercises/practice/etl/lib/ETL.pm @@ -1,6 +1,6 @@ package ETL; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/food-chain/lib/FoodChain.pm b/exercises/practice/food-chain/lib/FoodChain.pm index cec80c35..b964281f 100644 --- a/exercises/practice/food-chain/lib/FoodChain.pm +++ b/exercises/practice/food-chain/lib/FoodChain.pm @@ -1,6 +1,6 @@ package FoodChain; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/gigasecond/lib/Gigasecond.pm b/exercises/practice/gigasecond/lib/Gigasecond.pm index f73651a8..c5a3550d 100644 --- a/exercises/practice/gigasecond/lib/Gigasecond.pm +++ b/exercises/practice/gigasecond/lib/Gigasecond.pm @@ -1,6 +1,6 @@ package Gigasecond; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/grade-school/lib/GradeSchool.pm b/exercises/practice/grade-school/lib/GradeSchool.pm index be9f6bce..7f2e8710 100644 --- a/exercises/practice/grade-school/lib/GradeSchool.pm +++ b/exercises/practice/grade-school/lib/GradeSchool.pm @@ -1,6 +1,6 @@ package GradeSchool; -use v5.38; +use v5.40; use Moo; sub add ( $self, $student, $grade ) { diff --git a/exercises/practice/grains/lib/Grains.pm b/exercises/practice/grains/lib/Grains.pm index f5d0a4df..354da219 100644 --- a/exercises/practice/grains/lib/Grains.pm +++ b/exercises/practice/grains/lib/Grains.pm @@ -1,6 +1,6 @@ package Grains; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/hamming/lib/Hamming.pm b/exercises/practice/hamming/lib/Hamming.pm index 9fbedaf3..091dfaca 100644 --- a/exercises/practice/hamming/lib/Hamming.pm +++ b/exercises/practice/hamming/lib/Hamming.pm @@ -1,6 +1,6 @@ package Hamming; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/hello-world/lib/HelloWorld.pm b/exercises/practice/hello-world/lib/HelloWorld.pm index bba6d74f..51199785 100644 --- a/exercises/practice/hello-world/lib/HelloWorld.pm +++ b/exercises/practice/hello-world/lib/HelloWorld.pm @@ -1,7 +1,7 @@ # Declare package 'HelloWorld' package HelloWorld; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/house/lib/House.pm b/exercises/practice/house/lib/House.pm index 970f4fe6..dbd12de6 100644 --- a/exercises/practice/house/lib/House.pm +++ b/exercises/practice/house/lib/House.pm @@ -1,6 +1,6 @@ package House; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/kindergarten-garden/lib/KindergartenGarden.pm b/exercises/practice/kindergarten-garden/lib/KindergartenGarden.pm index 118498f6..db2434db 100644 --- a/exercises/practice/kindergarten-garden/lib/KindergartenGarden.pm +++ b/exercises/practice/kindergarten-garden/lib/KindergartenGarden.pm @@ -1,6 +1,6 @@ package KindergartenGarden; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/largest-series-product/.meta/template-data.yaml b/exercises/practice/largest-series-product/.meta/template-data.yaml index f4de170e..d0a077ca 100644 --- a/exercises/practice/largest-series-product/.meta/template-data.yaml +++ b/exercises/practice/largest-series-product/.meta/template-data.yaml @@ -4,7 +4,7 @@ properties: largestProduct: test: |- use Data::Dmp; - $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; + local $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; if (!ref $case->{expected}) { sprintf(<<'END', dmp($case->{input}{digits}), $case->{input}{span}, $case->{expected}, dmp($case->{description})); is( diff --git a/exercises/practice/largest-series-product/lib/LargestSeriesProduct.pm b/exercises/practice/largest-series-product/lib/LargestSeriesProduct.pm index 9ef7f3d2..a3ef0502 100644 --- a/exercises/practice/largest-series-product/lib/LargestSeriesProduct.pm +++ b/exercises/practice/largest-series-product/lib/LargestSeriesProduct.pm @@ -1,6 +1,6 @@ package LargestSeriesProduct; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/leap/lib/Leap.pm b/exercises/practice/leap/lib/Leap.pm index edf8b6ba..a95bffd0 100644 --- a/exercises/practice/leap/lib/Leap.pm +++ b/exercises/practice/leap/lib/Leap.pm @@ -1,7 +1,7 @@ # Declare package 'Leap' package Leap; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/luhn/.meta/template-data.yaml b/exercises/practice/luhn/.meta/template-data.yaml index ed85ab9b..648948ab 100644 --- a/exercises/practice/luhn/.meta/template-data.yaml +++ b/exercises/practice/luhn/.meta/template-data.yaml @@ -4,7 +4,7 @@ properties: valid: test: |- use Data::Dmp; - $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; + local $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; sprintf(<<'END', dmp($case->{input}{value}), $case->{expected} ? ('T', '# True') : ('DF', '# Defined but False'), dmp($case->{description})); is( is_luhn_valid(%s), diff --git a/exercises/practice/luhn/lib/Luhn.pm b/exercises/practice/luhn/lib/Luhn.pm index 10b73036..cfb4c8e4 100644 --- a/exercises/practice/luhn/lib/Luhn.pm +++ b/exercises/practice/luhn/lib/Luhn.pm @@ -1,6 +1,6 @@ package Luhn; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/matrix/lib/Matrix.pm b/exercises/practice/matrix/lib/Matrix.pm index df8a71b5..3f2057ca 100644 --- a/exercises/practice/matrix/lib/Matrix.pm +++ b/exercises/practice/matrix/lib/Matrix.pm @@ -1,6 +1,6 @@ package Matrix; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/meetup/lib/Meetup.pm b/exercises/practice/meetup/lib/Meetup.pm index cd53c1dc..d2a1a524 100644 --- a/exercises/practice/meetup/lib/Meetup.pm +++ b/exercises/practice/meetup/lib/Meetup.pm @@ -1,6 +1,6 @@ package Meetup; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/minesweeper/lib/Minesweeper.pm b/exercises/practice/minesweeper/lib/Minesweeper.pm index 057e7f64..b0e25086 100644 --- a/exercises/practice/minesweeper/lib/Minesweeper.pm +++ b/exercises/practice/minesweeper/lib/Minesweeper.pm @@ -1,6 +1,6 @@ package Minesweeper; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/nucleotide-count/lib/NucleotideCount.pm b/exercises/practice/nucleotide-count/lib/NucleotideCount.pm index 5ec17006..eb760f71 100644 --- a/exercises/practice/nucleotide-count/lib/NucleotideCount.pm +++ b/exercises/practice/nucleotide-count/lib/NucleotideCount.pm @@ -1,6 +1,6 @@ package NucleotideCount; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/ocr-numbers/lib/OCRNumbers.pm b/exercises/practice/ocr-numbers/lib/OCRNumbers.pm index 07f0b101..2a0825fc 100644 --- a/exercises/practice/ocr-numbers/lib/OCRNumbers.pm +++ b/exercises/practice/ocr-numbers/lib/OCRNumbers.pm @@ -1,6 +1,6 @@ package OCRNumbers; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/palindrome-products/lib/PalindromeProducts.pm b/exercises/practice/palindrome-products/lib/PalindromeProducts.pm index 67c1204c..b0bb762e 100644 --- a/exercises/practice/palindrome-products/lib/PalindromeProducts.pm +++ b/exercises/practice/palindrome-products/lib/PalindromeProducts.pm @@ -1,6 +1,6 @@ package PalindromeProducts; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/pascals-triangle/lib/PascalsTriangle.pm b/exercises/practice/pascals-triangle/lib/PascalsTriangle.pm index d0459e57..c681691f 100644 --- a/exercises/practice/pascals-triangle/lib/PascalsTriangle.pm +++ b/exercises/practice/pascals-triangle/lib/PascalsTriangle.pm @@ -1,6 +1,6 @@ package PascalsTriangle; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/phone-number/.meta/template-data.yaml b/exercises/practice/phone-number/.meta/template-data.yaml index 64a535ee..d0474176 100644 --- a/exercises/practice/phone-number/.meta/template-data.yaml +++ b/exercises/practice/phone-number/.meta/template-data.yaml @@ -3,7 +3,7 @@ properties: clean: test: |- use Data::Dmp; - $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; + local $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; if (!ref $case->{expected}) { sprintf(<<~END, map {dmp $_} $case->{input}{phrase}, @{$case}{qw}); is( diff --git a/exercises/practice/phone-number/lib/PhoneNumber.pm b/exercises/practice/phone-number/lib/PhoneNumber.pm index b1ca65f3..0e94ad2d 100644 --- a/exercises/practice/phone-number/lib/PhoneNumber.pm +++ b/exercises/practice/phone-number/lib/PhoneNumber.pm @@ -1,6 +1,6 @@ package PhoneNumber; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/pig-latin/lib/PigLatin.pm b/exercises/practice/pig-latin/lib/PigLatin.pm index b9a71fd2..edfcdf51 100644 --- a/exercises/practice/pig-latin/lib/PigLatin.pm +++ b/exercises/practice/pig-latin/lib/PigLatin.pm @@ -1,6 +1,6 @@ package PigLatin; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/prime-factors/lib/PrimeFactors.pm b/exercises/practice/prime-factors/lib/PrimeFactors.pm index 45b77a2b..bb5da7e3 100644 --- a/exercises/practice/prime-factors/lib/PrimeFactors.pm +++ b/exercises/practice/prime-factors/lib/PrimeFactors.pm @@ -1,6 +1,6 @@ package PrimeFactors; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/proverb/lib/Proverb.pm b/exercises/practice/proverb/lib/Proverb.pm index 846c4fe5..cd386b71 100644 --- a/exercises/practice/proverb/lib/Proverb.pm +++ b/exercises/practice/proverb/lib/Proverb.pm @@ -1,6 +1,6 @@ package Proverb; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/pythagorean-triplet/lib/PythagoreanTriplet.pm b/exercises/practice/pythagorean-triplet/lib/PythagoreanTriplet.pm index 02e23bcf..8b7d519c 100644 --- a/exercises/practice/pythagorean-triplet/lib/PythagoreanTriplet.pm +++ b/exercises/practice/pythagorean-triplet/lib/PythagoreanTriplet.pm @@ -1,6 +1,6 @@ package PythagoreanTriplet; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/queen-attack/lib/Queen.pm b/exercises/practice/queen-attack/lib/Queen.pm index bfd7464e..2cd3d8c1 100644 --- a/exercises/practice/queen-attack/lib/Queen.pm +++ b/exercises/practice/queen-attack/lib/Queen.pm @@ -1,6 +1,6 @@ package Queen; -use v5.38; +use v5.40; use Moo; has row => ( diff --git a/exercises/practice/raindrops/.meta/template-data.yaml b/exercises/practice/raindrops/.meta/template-data.yaml index 8690ae1b..b5a7a331 100644 --- a/exercises/practice/raindrops/.meta/template-data.yaml +++ b/exercises/practice/raindrops/.meta/template-data.yaml @@ -4,7 +4,7 @@ properties: convert: test: |- use Data::Dmp; - $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; + local $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; sprintf(<<'END', $case->{input}{number}, map {dmp $_} $case->@{qw}); is( raindrop(%s), diff --git a/exercises/practice/raindrops/lib/Raindrops.pm b/exercises/practice/raindrops/lib/Raindrops.pm index 90a05fd4..28776d2f 100644 --- a/exercises/practice/raindrops/lib/Raindrops.pm +++ b/exercises/practice/raindrops/lib/Raindrops.pm @@ -1,6 +1,6 @@ package Raindrops; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/rna-transcription/lib/RNA.pm b/exercises/practice/rna-transcription/lib/RNA.pm index f05083e7..6905d304 100644 --- a/exercises/practice/rna-transcription/lib/RNA.pm +++ b/exercises/practice/rna-transcription/lib/RNA.pm @@ -1,6 +1,6 @@ package RNA; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/robot-name/lib/RobotName.pm b/exercises/practice/robot-name/lib/RobotName.pm index 8342e3ee..918154a8 100644 --- a/exercises/practice/robot-name/lib/RobotName.pm +++ b/exercises/practice/robot-name/lib/RobotName.pm @@ -1,7 +1,7 @@ # This will be class 'RobotName', defined using Moo (https://perlmaven.com/oop-with-moo) package RobotName; -use v5.38; +use v5.40; use Moo; # Declare a "name" attribute that is is 'rwp', read-write protected: diff --git a/exercises/practice/robot-simulator/lib/Robot.pm b/exercises/practice/robot-simulator/lib/Robot.pm index 230085f0..a1b3b473 100644 --- a/exercises/practice/robot-simulator/lib/Robot.pm +++ b/exercises/practice/robot-simulator/lib/Robot.pm @@ -1,6 +1,6 @@ package Robot; -use v5.38; +use v5.40; use Moo; use List::Util qw; diff --git a/exercises/practice/robot-simulator/t/robot-simulator.t b/exercises/practice/robot-simulator/t/robot-simulator.t index b318a9ff..94ca305a 100755 --- a/exercises/practice/robot-simulator/t/robot-simulator.t +++ b/exercises/practice/robot-simulator/t/robot-simulator.t @@ -71,7 +71,7 @@ subtest "Moving forward one: facing north increments Y" => sub { # begin: f0dc23 subtest "Moving forward one: facing south decrements Y" => sub { # begin: 2786cf80-5bbf-44b0-9503-a89a9c5789da my $robot = Robot->new( x => 0, y => 0, direction => "south" )->enact("A"); - is( $robot->x, 0, "x" ); + is( $robot->x, 0, "x" ); is( $robot->y, -1, "y" ); is( $robot->direction, "south", "direction" ); }; # end: 2786cf80-5bbf-44b0-9503-a89a9c5789da @@ -86,7 +86,7 @@ subtest "Moving forward one: facing east increments X" => sub { # begin: 84bf3c8 subtest "Moving forward one: facing west decrements X" => sub { # begin: bb69c4a7-3bbf-4f64-b415-666fa72d7b04 my $robot = Robot->new( x => 0, y => 0, direction => "west" )->enact("A"); is( $robot->x, -1, "x" ); - is( $robot->y, 0, "y" ); + is( $robot->y, 0, "y" ); is( $robot->direction, "west", "direction" ); }; # end: bb69c4a7-3bbf-4f64-b415-666fa72d7b04 @@ -100,7 +100,7 @@ subtest "Follow series of instructions: moving east and north from README" => su subtest "Follow series of instructions: moving west and north" => sub { # begin: f30e4955-4b47-4aa3-8b39-ae98cfbd515b my $robot = Robot->new( x => 0, y => 0, direction => "north" )->enact("LAAARALA"); is( $robot->x, -4, "x" ); - is( $robot->y, 1, "y" ); + is( $robot->y, 1, "y" ); is( $robot->direction, "west", "direction" ); }; # end: f30e4955-4b47-4aa3-8b39-ae98cfbd515b diff --git a/exercises/practice/roman-numerals/lib/RomanNumerals.pm b/exercises/practice/roman-numerals/lib/RomanNumerals.pm index b9c55cb8..fc65d9bc 100644 --- a/exercises/practice/roman-numerals/lib/RomanNumerals.pm +++ b/exercises/practice/roman-numerals/lib/RomanNumerals.pm @@ -1,6 +1,6 @@ package RomanNumerals; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/saddle-points/lib/SaddlePoints.pm b/exercises/practice/saddle-points/lib/SaddlePoints.pm index 09344858..8d35c4df 100644 --- a/exercises/practice/saddle-points/lib/SaddlePoints.pm +++ b/exercises/practice/saddle-points/lib/SaddlePoints.pm @@ -1,6 +1,6 @@ package SaddlePoints; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/say/lib/Say.pm b/exercises/practice/say/lib/Say.pm index e5a0b881..9f638811 100644 --- a/exercises/practice/say/lib/Say.pm +++ b/exercises/practice/say/lib/Say.pm @@ -1,6 +1,6 @@ package Say; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/scrabble-score/lib/Scrabble.pm b/exercises/practice/scrabble-score/lib/Scrabble.pm index 76cf2be9..b5b021b1 100644 --- a/exercises/practice/scrabble-score/lib/Scrabble.pm +++ b/exercises/practice/scrabble-score/lib/Scrabble.pm @@ -1,6 +1,6 @@ package Scrabble; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/secret-handshake/lib/SecretHandshake.pm b/exercises/practice/secret-handshake/lib/SecretHandshake.pm index 5b122492..92959edf 100644 --- a/exercises/practice/secret-handshake/lib/SecretHandshake.pm +++ b/exercises/practice/secret-handshake/lib/SecretHandshake.pm @@ -1,6 +1,6 @@ package SecretHandshake; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/series/.meta/template-data.yaml b/exercises/practice/series/.meta/template-data.yaml index 4bd99766..ec78249d 100644 --- a/exercises/practice/series/.meta/template-data.yaml +++ b/exercises/practice/series/.meta/template-data.yaml @@ -4,7 +4,7 @@ properties: slices: test: |- use Data::Dmp; - $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; + local $Data::Dmp::OPT_STRINGIFY_NUMBERS = 1; if (ref $case->{expected} ne 'HASH') { sprintf(<<~'END', dmp($case->{input}{series}), $case->{input}{sliceLength}, map {dmp $_} $case->@{qw}); is( diff --git a/exercises/practice/series/lib/Series.pm b/exercises/practice/series/lib/Series.pm index 396578c1..abf39664 100644 --- a/exercises/practice/series/lib/Series.pm +++ b/exercises/practice/series/lib/Series.pm @@ -1,6 +1,6 @@ package Series; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/sieve/lib/Sieve.pm b/exercises/practice/sieve/lib/Sieve.pm index e7dd92ab..b9c23b74 100644 --- a/exercises/practice/sieve/lib/Sieve.pm +++ b/exercises/practice/sieve/lib/Sieve.pm @@ -1,6 +1,6 @@ package Sieve; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/simple-cipher/lib/SimpleCipher.pm b/exercises/practice/simple-cipher/lib/SimpleCipher.pm index 6878ad5f..bd1351fc 100644 --- a/exercises/practice/simple-cipher/lib/SimpleCipher.pm +++ b/exercises/practice/simple-cipher/lib/SimpleCipher.pm @@ -1,6 +1,6 @@ package SimpleCipher; -use v5.38; +use v5.40; use Moo; has key => ( diff --git a/exercises/practice/space-age/lib/SpaceAge.pm b/exercises/practice/space-age/lib/SpaceAge.pm index 2d441422..6d9d8671 100644 --- a/exercises/practice/space-age/lib/SpaceAge.pm +++ b/exercises/practice/space-age/lib/SpaceAge.pm @@ -1,6 +1,6 @@ package SpaceAge; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/strain/lib/Strain.pm b/exercises/practice/strain/lib/Strain.pm index fb4d10a5..dabef319 100644 --- a/exercises/practice/strain/lib/Strain.pm +++ b/exercises/practice/strain/lib/Strain.pm @@ -1,6 +1,6 @@ package Strain; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/sublist/lib/Sublist.pm b/exercises/practice/sublist/lib/Sublist.pm index afbcddf0..a533e774 100644 --- a/exercises/practice/sublist/lib/Sublist.pm +++ b/exercises/practice/sublist/lib/Sublist.pm @@ -1,6 +1,6 @@ package Sublist; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/sum-of-multiples/lib/SumOfMultiples.pm b/exercises/practice/sum-of-multiples/lib/SumOfMultiples.pm index 5e32757d..7d842886 100644 --- a/exercises/practice/sum-of-multiples/lib/SumOfMultiples.pm +++ b/exercises/practice/sum-of-multiples/lib/SumOfMultiples.pm @@ -1,6 +1,6 @@ package SumOfMultiples; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/triangle/lib/Triangle.pm b/exercises/practice/triangle/lib/Triangle.pm index 09ab74e7..ca0b55a7 100644 --- a/exercises/practice/triangle/lib/Triangle.pm +++ b/exercises/practice/triangle/lib/Triangle.pm @@ -1,6 +1,6 @@ package Triangle; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/twelve-days/lib/TwelveDays.pm b/exercises/practice/twelve-days/lib/TwelveDays.pm index 1aaa1c39..756b5180 100644 --- a/exercises/practice/twelve-days/lib/TwelveDays.pm +++ b/exercises/practice/twelve-days/lib/TwelveDays.pm @@ -1,6 +1,6 @@ package TwelveDays; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/two-fer/lib/TwoFer.pm b/exercises/practice/two-fer/lib/TwoFer.pm index 6dc4e09f..28c2811b 100644 --- a/exercises/practice/two-fer/lib/TwoFer.pm +++ b/exercises/practice/two-fer/lib/TwoFer.pm @@ -1,6 +1,6 @@ package TwoFer; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/word-count/lib/WordCount.pm b/exercises/practice/word-count/lib/WordCount.pm index 7159372b..cae25585 100644 --- a/exercises/practice/word-count/lib/WordCount.pm +++ b/exercises/practice/word-count/lib/WordCount.pm @@ -1,6 +1,6 @@ package WordCount; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/exercises/practice/wordy/lib/Wordy.pm b/exercises/practice/wordy/lib/Wordy.pm index 96c47e8a..148fe7a0 100644 --- a/exercises/practice/wordy/lib/Wordy.pm +++ b/exercises/practice/wordy/lib/Wordy.pm @@ -1,6 +1,6 @@ package Wordy; -use v5.38; +use v5.40; use Exporter qw; our @EXPORT_OK = qw; diff --git a/lib/Exercism/Generator.pm b/lib/Exercism/Generator.pm index c1f546e3..b2fdbaad 100644 --- a/lib/Exercism/Generator.pm +++ b/lib/Exercism/Generator.pm @@ -7,7 +7,7 @@ use JSON::PP (); use List::Util qw; use Path::Tiny qw; use Perl::Tidy (); -use Template::Mustache qw; +use Template::Mustache (); use TOML::Parser (); use YAML qw; @@ -92,7 +92,6 @@ sub _render { ); delete $data{experimental}; - undef $Data::Dmp::OPT_STRINGIFY_NUMBERS; Perl::Tidy::perltidy( source => \$rendered, diff --git a/t/files/generated-tests.t b/t/files/generated-tests.t index 4bac7491..5d0191fd 100755 --- a/t/files/generated-tests.t +++ b/t/files/generated-tests.t @@ -23,8 +23,6 @@ for ( sort { $a cmp $b } BASE_DIR->child( 'exercises', 'practice' )->children ) { if ( $_->child( '.meta', 'template-data.yaml' )->is_file ) { - - { no warnings qw; $Data::Dmp::OPT_STRINGIFY_NUMBERS = 0; } # Option is used in several exercises, reset to default before running generator. is( [ split( /\n/, $_->child( 't', $_->basename . '.t' )->slurp_utf8 ) ], [ split( diff --git a/templates/module.mustache b/templates/module.mustache index 796becb7..e675dfd9 100644 --- a/templates/module.mustache +++ b/templates/module.mustache @@ -2,7 +2,7 @@ {{/package_comment}}package {{&package}}; {{^older_perl_support}} -use v5.38;{{/older_perl_support}}{{#moo}} +use v5.40;{{/older_perl_support}}{{#moo}} use Moo;{{/moo}}{{#older_perl_support}}{{^moo}} use strict; use warnings;{{/moo}}