Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add a p6 translation under glob
  • Loading branch information
TimToady committed Feb 23, 2015
1 parent e2d6ed7 commit f5f22d3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Language/5to6.pod
Expand Up @@ -53,7 +53,8 @@ method call syntax now uses a dot instead of an arrow:
$person.name # Perl 6
The dot notation is both easier to type and more of an industry standard.
But we also wanted to steal the arrow for something else.
But we also wanted to steal the arrow for something else. (Concatenation
is now done with the C<~> operator, if you were wondering.)
=head3 Whitespace
Expand Down Expand Up @@ -282,6 +283,15 @@ before translating into Perl 6.
open my $in_file, '<', $path or die;
my ($line1, $line2) = read_2($in_file);
And here's just one possible Perl 6 translation:
# Perl 6
sub read-n($fh, $n) {
return $fh.get xx $n;
}
my $in-file = open $path or die;
my ($line1, $line2) = read-n($in-file, 2);
=head3 Reference creation
In Perl 5, references to anonymous arrays and hashes and subs are returned
Expand Down

0 comments on commit f5f22d3

Please sign in to comment.