Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 2012.08
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 31 lines (21 sloc) 0.468 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#!./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');


Something went wrong with that request. Please try again.