File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ method call syntax now uses a dot instead of an arrow:
53
53
$person.name # Perl 6
54
54
55
55
The dot notation is both easier to type and more of an industry standard.
56
- But we also wanted to steal the arrow for something else.
56
+ But we also wanted to steal the arrow for something else. (Concatenation
57
+ is now done with the C < ~ > operator, if you were wondering.)
57
58
58
59
= head3 Whitespace
59
60
@@ -282,6 +283,15 @@ before translating into Perl 6.
282
283
open my $in_file, '<', $path or die;
283
284
my ($line1, $line2) = read_2($in_file);
284
285
286
+ And here's just one possible Perl 6 translation:
287
+
288
+ # Perl 6
289
+ sub read-n($fh, $n) {
290
+ return $fh.get xx $n;
291
+ }
292
+ my $in-file = open $path or die;
293
+ my ($line1, $line2) = read-n($in-file, 2);
294
+
285
295
= head3 Reference creation
286
296
287
297
In Perl 5, references to anonymous arrays and hashes and subs are returned
You can’t perform that action at this time.
0 commit comments