Created
January 29, 2023 21:58
-
-
Save thundergnat/ff2f5e228fdb05c6a3bb680b28e9e68c 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
sub ValidateLineType($ln) returns Int { | |
my $lt = $ln.split( /<ws>/, :skip-empty )[0]; | |
($lt ~~ 0..5) ?? $lt.Int !! -1 | |
} | |
my @fp = # open "data.ldr", :r; | |
#Meh, just load some data into the array | |
"0 0\n1 0\n2 0\n3 0\n4 0\n5 0\n6 0\n12 5\n3 3\n4\t\t3\n".lines; | |
say .&ValidateLineType for @fp; | |
my $currentline = 0; | |
say my $linetype = ValidateLineType(@fp[$currentline]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment