-
-
Save mpapec/43fcf6f6a0ba45ad38aa144ea270ea15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# errors are at odd indices | |
sub ioErr { | |
my ($c, @arr) = @_; | |
# rethrow exception | |
die($arr[1]) if ref($arr[1]); | |
my $i = 0; | |
my $err = join "; ", | |
grep { $i++ %2 and $_ } @arr; | |
die({err => $err}) if $err; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment