Skip to content

Instantly share code, notes, and snippets.

View haukex's full-sized avatar
🍔

Hauke D haukex

🍔
View GitHub Profile
# Looks like overloaded &{} doesn't work with after_parse in either of Text::CSV_{PP,XS}
# so need to use \&{...} to get a real coderef. That's not a huge problem.
# This will die on any row that breaks the constraint...
after_parse => \&{ Tuple[Str, Str, Int, Bool, Optional[Num]] }
# This will skip on any row that breaks the constraint...
after_parse => sub {
state $type = Tuple[Str, Str, Int, Bool, Optional[Num]];
state $check = $type->compiled_check;