aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-052/yet-ebreo/perl/ch-1.pl33
1 files changed, 33 insertions, 0 deletions
diff --git a/challenge-052/yet-ebreo/perl/ch-1.pl b/challenge-052/yet-ebreo/perl/ch-1.pl
new file mode 100644
index 0000000000..1f3064e74a
--- /dev/null
+++ b/challenge-052/yet-ebreo/perl/ch-1.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use feature 'say';
+
+my ($start,$end) = @ARGV;
+
+die ("Usage:\n\tch1.pl <start> <end>\n\n") if @ARGV<2;
+
+my @range = ($start..$end);
+my $step = "123456789";
+say "List of stepping number(s) from $start to $end";
+"@range " =~ "$& " && say $& while $step =~ s/.(..)/$1/;
+=begin
+perl .\ch-1.pl 124 780
+List of stepping number(s) from 124 to 780
+234
+345
+456
+567
+678
+
+perl .\ch-1.pl 100 999
+List of stepping number(s) from 100 to 999
+123
+234
+345
+456
+567
+678
+789
+=cut \ No newline at end of file