We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 861648f commit ff69616Copy full SHA for ff69616
doc/Language/5to6-nutshell.pod
@@ -1097,6 +1097,22 @@ e.g.:
1097
my @lines = "test-file".IO.slurp.split(/\n/);
1098
say @lines.elems; #-> 4
1099
1100
+=head2 Trapping the standard output of executables.
1101
+
1102
+Whereas in Perl 5 you would do:
1103
1104
+ my $arg = 'Hello';
1105
+ my $captured = `echo "$arg"`;
1106
+ my $captured = qx(echo "$arg");
1107
1108
+In Perl 6, you can do:
1109
1110
1111
+ my $captured = qq:x(echo "{$arg}");
1112
1113
+Beware of interpolating strings with special shell characters! (Which is a
1114
+problem in Perl 5 as well).
1115
1116
=head1 Environment variables
1117
1118
=head2 Perl module library path
0 commit comments