Skip to content

Instantly share code, notes, and snippets.

@mpapec

mpapec/m.pl Secret

Created September 6, 2016 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpapec/43fcf6f6a0ba45ad38aa144ea270ea15 to your computer and use it in GitHub Desktop.
Save mpapec/43fcf6f6a0ba45ad38aa144ea270ea15 to your computer and use it in GitHub Desktop.
# 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