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: doc/Language/5to6-nutshell.pod6
+56-16Lines changed: 56 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
This page attempts to provide a fast-path to the changes in syntax and
8
8
semantics from Perl 5 to Perl 6. Whatever worked in Perl 5 and must be
9
9
written differently in Perl 6, should be listed here (whereas many
10
-
I<new> Perl 6 features and idioms are not).
10
+
I<new> Perl 6 features and idioms need not).
11
11
12
12
Hence this should not be mistaken for a beginner tutorial or a
13
13
promotional overview of Perl 6; it is intended as a technical reference
@@ -284,12 +284,13 @@ first $coderef, @values, :k;
284
284
=enditem
285
285
286
286
=beginitem
287
-
C<&foo;>I<and>C<goto &foo;>I<for re-using the caller's argument list /
288
-
replacing the caller in the call stack>. Perl 6 can use either L<C<callsame>|/language/functions#index-entry-dispatch_callsame> for re-dispatching or L<C<nextsame>|/language/functions#index-entry-dispatch_nextsame> and L<C<nextwith>|/language/functions#index-entry-dispatch_nextwith>, which have no exact equivalent in Perl 5.
289
-
290
-
=begincomment
291
-
# TODO: Suggest .nextsame and .nextwith once they've been implemented in Rakudo.
292
-
=endcomment
287
+
C<&foo;>I<and>C<goto &foo;>I<for re-using the caller's argument
288
+
list / replacing the caller in the call stack>. Perl 6 can use either
289
+
L<C<callsame>|/language/functions#index-entry-dispatch_callsame> for
290
+
re-dispatching or
291
+
L<C<nextsame>|/language/functions#index-entry-dispatch_nextsame> and
292
+
L<C<nextwith>|/language/functions#index-entry-dispatch_nextwith>, which have no
293
+
exact equivalent in Perl 5.
293
294
294
295
=forcode :lang<perl5>
295
296
sub foo { say "before"; &bar; say "after" } # Perl 5
Manipulate where modules are looked up at compile time. The underlying logic
1237
-
is B<very> different from Perl 5, but in most cases, C<use lib> in Perl 6
1238
-
works the same as in Perl 5.
1275
+
Manipulate where modules are looked up at compile time. The underlying logic is
1276
+
B<very> different from Perl 5, but in the case you are using a equivalent
1277
+
syntax, C<use lib> in Perl 6 works the same as in Perl 5.
1239
1278
1240
1279
=head3C<mro>
1241
1280
@@ -1332,7 +1371,8 @@ This is now the default behavior.
1332
1371
1333
1372
=itemC<-S>, C<-T>.
1334
1373
1335
-
This has been eliminated. Several ways to L<replicate "taint" mode are discussed in Reddit|https://www.reddit.com/r/perl6/comments/718z4o/taint_mode_for_perl_6/>.
1374
+
This has been eliminated. Several ways to
1375
+
L<replicate "taint" mode are discussed in Reddit|https://www.reddit.com/r/perl6/comments/718z4o/taint_mode_for_perl_6/>.
1336
1376
1337
1377
=head1File-related operations
1338
1378
@@ -1370,7 +1410,7 @@ the C<lines> method on the result of C<slurp> instead:
1370
1410
1371
1411
my @lines = "test-file".IO.slurp.lines; # also auto-chomps
1372
1412
1373
-
=head2Trapping the standard output of executables.
1413
+
=head2Capturing the standard output of executables.
1374
1414
1375
1415
Whereas in Perl 5 you would do:
1376
1416
@@ -1489,7 +1529,7 @@ C<is export> role on the relevant subs and I<all> subs with this role are
1489
1529
then exported. Hence, the following module C<Bar> exports the subs C<foo>
0 commit comments