From 38c910924f9b7fe5c5ae004474ac971ac0ce340c Mon Sep 17 00:00:00 2001 From: Dave Jacoby Date: Tue, 7 Jan 2020 22:59:15 -0500 Subject: Week 42 --- challenge-042/dave-jacoby/perl5/ch-1.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 challenge-042/dave-jacoby/perl5/ch-1.pl diff --git a/challenge-042/dave-jacoby/perl5/ch-1.pl b/challenge-042/dave-jacoby/perl5/ch-1.pl new file mode 100644 index 0000000000..327ea71539 --- /dev/null +++ b/challenge-042/dave-jacoby/perl5/ch-1.pl @@ -0,0 +1,13 @@ +#!/usr/bin/env perl + +use feature qw{ say }; +use strict; +use warnings; + +# Too easy - sprintf gives us base conversion almost for free + +for my $d ( 0 .. 50 ) { + my $o = sprintf '%o', $d; + say qq{Decimal $d = Octal $o}; +} + -- cgit