diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2022-10-03 19:52:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-03 19:52:48 +0100 |
| commit | 69f6ed66c41f10846c0fcfc65fc0233345237b43 (patch) | |
| tree | 51e8bc0435bf26f4b95b6b193742fadea1e5b55b | |
| parent | a22462287d3459f3446535e701c95095a9f7c379 (diff) | |
| parent | 7ddb964fd18cb74813435ee3bb9442ee5ff3ca19 (diff) | |
| download | perlweeklychallenge-club-69f6ed66c41f10846c0fcfc65fc0233345237b43.tar.gz perlweeklychallenge-club-69f6ed66c41f10846c0fcfc65fc0233345237b43.tar.bz2 perlweeklychallenge-club-69f6ed66c41f10846c0fcfc65fc0233345237b43.zip | |
Merge pull request #6836 from tcheukueppo/kueppo-pwc-185-ch1
kueppo pwc-185 ch-1.pl
| -rw-r--r-- | challenge-185/kueppo-wesley/Perl/ch-1.pl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-185/kueppo-wesley/Perl/ch-1.pl b/challenge-185/kueppo-wesley/Perl/ch-1.pl new file mode 100644 index 0000000000..0fabbf7099 --- /dev/null +++ b/challenge-185/kueppo-wesley/Perl/ch-1.pl @@ -0,0 +1,14 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Test::More; + +my ( @macs, @result ) = qw(1ac2.34f0.b1c2 abc1.20f1.345a); + +push @result, tr/.//dr =~ s/(..)(?!$)/$1:/gr foreach @macs; + +is_deeply( [ @result ], [ qw(1a:c2:34:f0:b1:c2 ab:c1:20:f1:34:5a) ], "Properly converted mac addresses" ); + +done_testing( 1 ); |
