Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 2011.09
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (21 sloc) 0.468 kb
#!./parrot perl6.pbc
# check inline PIR
use v6;
say '1..3';
## inline directly
Q:PIR { say 'ok 1' };
## assigned to a variable
my $a = Q:PIR { %r = perl6_box_str 'ok 2' };
say $a;
## within a subroutine
sub foo($x) {
Q:PIR {
$P0 = find_lex '$x'
$S0 = repr_unbox_str $P0
say $S0
};
# a Q:PIR block returning nothing as last statement inside a block
# is a bad idea, so end on a happy note instead:
1;
}
foo('ok 3');
Jump to Line
Something went wrong with that request. Please try again.