diff options
| author | boblied <boblied@gmail.com> | 2020-07-30 07:35:46 -0500 |
|---|---|---|
| committer | boblied <boblied@gmail.com> | 2020-07-30 07:35:46 -0500 |
| commit | 5e8e14da71c5cb5ccb751f2c1edc7b72bf049138 (patch) | |
| tree | a15348dbd6200d854537649ce873bd6286574d2a /challenge-071/bob-lied | |
| parent | eba1f05b595c6c5336856b742563d69c66745147 (diff) | |
| download | perlweeklychallenge-club-5e8e14da71c5cb5ccb751f2c1edc7b72bf049138.tar.gz perlweeklychallenge-club-5e8e14da71c5cb5ccb751f2c1edc7b72bf049138.tar.bz2 perlweeklychallenge-club-5e8e14da71c5cb5ccb751f2c1edc7b72bf049138.zip | |
Simplify returning test result
Diffstat (limited to 'challenge-071/bob-lied')
| -rw-r--r-- | challenge-071/bob-lied/perl/ch-1.pl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/challenge-071/bob-lied/perl/ch-1.pl b/challenge-071/bob-lied/perl/ch-1.pl index 2dc752026f..50b2a0cbe1 100644 --- a/challenge-071/bob-lied/perl/ch-1.pl +++ b/challenge-071/bob-lied/perl/ch-1.pl @@ -102,9 +102,8 @@ sub runTests is_deeply(peakElement(47, 11, 32, 8, 1, 9, 39, 14, 36, 23), [47, 32, 39, 36], "example 2"); - my @result = done_testing(); - say "@result"; - return $result[0]; + my ($result) = (done_testing())[0]; + return $result; } ########## MAIN ########## @@ -112,7 +111,7 @@ sub runTests my $doTest; GetOptions('test!' => \$doTest); -exit(runTests() ? 0 : 1) if $doTest; +exit(!runTests()) if $doTest; my $N = $ARGV[0] // 0; die Usage() unless $N > 1; |
