Skip to content

Commit 5a05c56

Browse files
committed
add where clause to MAIN example
1 parent 7fb512c commit 5a05c56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/Language/functions.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ and it's signature is the means by which command line arguments can be parsed.
729729
Multi methods are supported and a usage method is automatically generated and
730730
displayed if no command line arguments are provided.
731731
732-
sub MAIN ( Int :$length = 24, :file($data) = 'file.dat', Bool :$verbose ) {
732+
sub MAIN ( Int :$length = 24, :file($data) where { .IO.f // die "file not found in $*CWD" } = 'file.dat', Bool :$verbose ) {
733733
say $length if $length.defined;
734734
say $data if $data.defined;
735735
say 'Verbosity ', ($verbose ?? 'on' !! 'off');

0 commit comments

Comments
 (0)