-
-
Save zoffixznet/1670ac204a8f13a8eb2a3bf252eb94de 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
#!/usr/bin/env perl6 | |
use nqp; | |
my $res := nqp::list; | |
my $lines := nqp::split("\n", 'foo.txt'.IO.slurp); | |
nqp::pop($lines); | |
my int $e = nqp::elems($lines); | |
my int $i = -1; | |
nqp::while( | |
nqp::islt_i(++$i, $e), | |
nqp::stmts( | |
(my $l := nqp::split(' # ', nqp::atpos($lines, $i))), | |
nqp::bindpos($res, nqp::atpos($l,0)-1, nqp::split(' ', nqp::atpos($l,1))))); | |
say nqp::elems($res); | |
say now - INIT now; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment