Anonymous user
Hello world/Line printer: Difference between revisions
→{{header|Perl 6}}: on second thought, it's best to first show the simplest way, then the "clever" way doesn't even need much explanation.
(→{{header|Perl 6}}: pull the comments out of the code and make them less confusing/dubious) |
(→{{header|Perl 6}}: on second thought, it's best to first show the simplest way, then the "clever" way doesn't even need much explanation.) |
||
Line 534:
=={{header|Perl 6}}==
<lang perl6>my $lp = open '/dev/lp0', :w;
$lp.say: 'Hello World!';
$lp.close;</lang>
Or using <code>given</code> to avoid having to write the variable name repeatedly:
<lang perl6>given open '/dev/lp0', :w {
.say: 'Hello World!';
.close;
}</lang>
=={{header|Phix}}==
|