From 5f5afa6e3ef438eaabbcbb0dbdbc8cca68beec50 Mon Sep 17 00:00:00 2001 From: Ysmael Ebreo Date: Mon, 2 Mar 2020 22:47:11 +0800 Subject: Added perl solution for ch#50-2 --- challenge-050/yet-ebreo/perl/ch-2.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 challenge-050/yet-ebreo/perl/ch-2.pl diff --git a/challenge-050/yet-ebreo/perl/ch-2.pl b/challenge-050/yet-ebreo/perl/ch-2.pl new file mode 100644 index 0000000000..b371280c49 --- /dev/null +++ b/challenge-050/yet-ebreo/perl/ch-2.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use feature 'say'; + +my @list = sort {$a - $b } split " ",$ARGV[0] || "2 6 1 3"; + +for my $i (0..~-@list) { + say $list[$i] if ~-@list-$i == $list[$i] +} +=begin +perl .\ch-2.pl "2 6 1 3" +2 +=cut \ No newline at end of file -- cgit