diff options
| author | Matthias Muth <matthias.muth@gmx.de> | 2024-09-15 01:28:46 +0200 |
|---|---|---|
| committer | Matthias Muth <matthias.muth@gmx.de> | 2024-09-15 01:34:15 +0200 |
| commit | d9aabf9d87d0c4eda948ac0d74f549fabd6aaaa0 (patch) | |
| tree | c5d6e717d934bd3217e512170b7cc843a2c51e39 | |
| parent | 8ac78317a27232f8df6770d09ee47644bccc7071 (diff) | |
| download | perlweeklychallenge-club-d9aabf9d87d0c4eda948ac0d74f549fabd6aaaa0.tar.gz perlweeklychallenge-club-d9aabf9d87d0c4eda948ac0d74f549fabd6aaaa0.tar.bz2 perlweeklychallenge-club-d9aabf9d87d0c4eda948ac0d74f549fabd6aaaa0.zip | |
Challenge 286 Task 1 and 2 solutions in Perl by Matthias Muth - Update
| -rwxr-xr-x | challenge-286/matthias-muth/perl/ch-1.pl | 3 | ||||
| -rwxr-xr-x | challenge-286/matthias-muth/perl/ch-2.pl | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/challenge-286/matthias-muth/perl/ch-1.pl b/challenge-286/matthias-muth/perl/ch-1.pl index 07caf58247..ef4bcc77d5 100755 --- a/challenge-286/matthias-muth/perl/ch-1.pl +++ b/challenge-286/matthias-muth/perl/ch-1.pl @@ -13,8 +13,7 @@ use v5.36; sub self_spammer() { # 'Slurp' the whole source file, and split it into words. - ( @ARGV, $/ ) = $0; - my @all_words = split " ", <>; + my @all_words = split " ", do { ( @ARGV, $/ ) = $0; <> }; # Return a random word. return $all_words[ rand( @all_words ) ]; diff --git a/challenge-286/matthias-muth/perl/ch-2.pl b/challenge-286/matthias-muth/perl/ch-2.pl index 3ab63eb5e7..f59d578375 100755 --- a/challenge-286/matthias-muth/perl/ch-2.pl +++ b/challenge-286/matthias-muth/perl/ch-2.pl @@ -14,7 +14,7 @@ use builtin 'indexed'; no warnings 'experimental::builtin'; # Using map to avoid temporary array. -# Enumerate pairs, use (index, pair ref) for map loop. +# Enumerate pairs, use [ index, pair ref ] for map loop. sub order_game( @ints ) { while ( @ints > 1 ) { @ints = map { |
