Skip to content

Commit 549c81a

Browse files
committed
Replace self-built words() with .words builtin
1 parent 7381d5d commit 549c81a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

categories/tutorial/01-word-wrap.pl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,10 @@
1717
my $count = 0;
1818
for $tempfile.lines {
1919
$count++;
20-
lines(words($_));
20+
lines(.words);
2121
}
2222
}
2323

24-
# Split a line into words (array)
25-
sub words ($in) {
26-
return $in.split(/\s/);
27-
}
28-
2924
# Print words, new line at word wrap, new line for paragraph
3025
sub lines (@in) {
3126
my $length = 0;

0 commit comments

Comments
 (0)