Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 870d189bbc
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (18 sloc) 0.604 kb
#!./parrot perl6.pbc
# check variables
use v6;
say '1..12';
my $o1 = 'ok 1'; say $o1;
my $o2; $o2 = 'ok 2'; say $o2;
my $a = 3; print 'ok '; say $a;
my $b; $b = 4; print 'ok '; say $b;
our $x = 5; say 'ok ', $x;
{ my $x = 6; say 'ok ', $x; };
if ($x + 2 == 7) { say 'ok ', $x + 2; }
{ my $x = 999; { our $x; say 'ok ', $x + 3; } }
## variable interpolation in strings
$b = 9; "ok $b" eq 'ok 9' and say 'ok 9';
'ok $b' ne 'ok 9' and say 'ok 10';
$b = "0x0b"; "ok $b" eq 'ok 0x0b' and say 'ok 11';
## nested 'our' declarations
$x = 'not ok 12'; { our $x = 'ok 12'; }; say $x;
Jump to Line
Something went wrong with that request. Please try again.