Skip to content

Instantly share code, notes, and snippets.

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 masak/82795 to your computer and use it in GitHub Desktop.
Save masak/82795 to your computer and use it in GitHub Desktop.
rakudo$ git diff
diff --git a/src/setting/Any-str.pm b/src/setting/Any-str.pm
index be0082b..66348a1 100644
--- a/src/setting/Any-str.pm
+++ b/src/setting/Any-str.pm
@@ -111,4 +111,10 @@ sub unpack($template, $target) {
}
}
+# TODO: '$filename as Str' once support for that is in place
+multi sub lines($filename) {
+ my $filehandle = open($filename, :r);
+ return lines($filehandle);
+}
+
# vim: ft=perl6
rakudo$ # ...compile
[...]
Linked: perl6
rakudo$ ./perl6 -e 'say lines("~/gwork/november/README")'
Null PMC access in find_method()
current instr.: '_block14' pc 66 (EVAL_16:40)
called from Sub '!UNIT_START' pc 17593 (src/builtins/guts.pir:358)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 950 (src/PCT/HLLCompiler.pir:527)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1510 (src/PCT/HLLCompiler.pir:798)
called from Sub 'parrot;Perl6;Compiler;main' pc 21977 (perl6.pir:164)
rakudo$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment