You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,26 @@
3
3
NAME
4
4
====
5
5
6
-
File::Find - Get a lazy list of a directory tree
6
+
File::Find - Get a lazy sequence of a directory tree
7
7
8
8
SYNOPSIS
9
9
========
10
10
11
11
use File::Find;
12
12
13
-
my @list := find(dir => 'foo');
13
+
my @list = lazy find(dir => 'foo'); # Keep laziness
14
14
say @list[0..3];
15
15
16
-
my $list = find(dir => 'foo');
16
+
my $list = find(dir => 'foo'); # Keep laziness
17
17
say $list[0..3];
18
18
19
+
my @list = find(dir => 'foo'); # Drop laziness
20
+
say @list[0..3];
21
+
19
22
DESCRIPTION
20
23
===========
21
24
22
-
`File::Find` allows you to get the contents of the given directory, recursively, depth first. The only exported function, `find()`, generates a lazy list of files in given directory. Every element of the list is an `IO::Path` object, described below. `find()` takes one (or more) named arguments. The `dir` argument is mandatory, and sets the directory `find()` will traverse. There are also few optional arguments. If more than one is passed, all of them must match for a file to be returned.
25
+
`File::Find` allows you to get the contents of the given directory, recursively, depth first. The only exported function, `find()`, generates a `Seq`of files in given directory. Every element of the `Seq` is an `IO::Path` object, described below. `find()` takes one (or more) named arguments. The `dir` argument is mandatory, and sets the directory `find()` will traverse. There are also few optional arguments. If more than one is passed, all of them must match for a file to be returned.
23
26
24
27
name
25
28
----
@@ -56,5 +59,5 @@ Please note, that this module is not trying to be the verbatim port of Perl's Fi
56
59
CAVEATS
57
60
=======
58
61
59
-
List assignment is eager in Raku, so if You assign `find()` result to an array, the elements will be copied and the laziness will be spoiled. For a proper lazy list, use either binding (`:=`) or assign a result to a scalar value (see SYNOPSIS).
62
+
List assignment is eager by default in Raku, so if you assign a `find()` result to an array, the laziness will be dropped by default. To keep the laziness either insert `lazy` or assign to a scalar value (see SYNOPSIS).
0 commit comments