Skip to content

Commit 67b76cf

Browse files
authored
Fixes assignment and iteration issues arising from the use of $dirs
Now changed to @Dirs and a proper list assignment, which is more accessible to beginners.
1 parent 9781d5d commit 67b76cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/Language/enumeration.pod6

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ sub check-dir-status($dir --> DirStat) {
3838
}
3939
4040
# test each of three directories by a non-root user
41-
my $dirs =
41+
my @dirs = (
4242
'/tmp', # normally writable by any user
4343
'/', # writable only by root
44-
'~/tmp'; # a non-existent dir in the user's home dir
45-
for $dirs -> $dir {
44+
'~/tmp' # a non-existent dir in the user's home dir
45+
);
46+
for @dirs -> $dir {
4647
my $stat = check-dir-status $dir;
4748
say "status of dir '$dir': $stat";
4849
if $stat ~~ CanWrite {

0 commit comments

Comments
 (0)