Skip to content

Commit

Permalink
expanded signature of lines multi
Browse files Browse the repository at this point in the history
Suggested by bacek++.
  • Loading branch information
Carl Masak committed Mar 21, 2009
1 parent 836900e commit d448f91
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/setting/Any-str.pm
Expand Up @@ -112,7 +112,17 @@ sub unpack($template, $target) {
}
# TODO: '$filename as Str' once support for that is in place
multi sub lines($filename) {
multi sub lines(Str $filename,
:$bin = False,
:$enc = 'Unicode',
:$nl = "\n",
:$chomp = True) {

fail 'Binary mode not supported yet' if $bin;
fail 'Encodings not supported yet' if $enc ne 'Unicode';
fail 'Fancy newlines not supported yet' if $nl ne "\n";
fail 'Lack of chomp not supported yet' if !$chomp;

my $filehandle = open($filename, :r);
return lines($filehandle);
}
Expand Down

0 comments on commit d448f91

Please sign in to comment.