Today I decided to try and test Pugs to see how well it does. Here was my first try:
pugs> my x = 2
*** Error:
unexpected "x"
expecting variable name or "("
at at line 1, column 4
pugs> my $x = 2;
2
pugs> my $x = "a";
'a'
pugs> my $x is Int = "a";
*** Error: No compatible subroutine found: &is
at App "&is" (App "&Int" (App "&prefix:=" (Syn "cxt"
{'Str';
App "&infix:~" ('a',
'')})))
pugs> my Int $x = 1;
*** Error:
unexpected "I"
expecting variable name or "("
at at line 1, column 4
pugs> my $a = sub { say "a" }
sub {...}
pugs> $a->()
*** Error:
unexpected ">" or "-"
expecting word character, ":", term postfix, operator, postfix conditional, post
fix loop, postfix iteration, ";" or end of input
at at line 1, column 3
pugs> $a()
a
bool::true
#!perl6 use v6;
my @tags = ("AMI ","ENG ","FRA ","SPA ","CAS ","A ","B ","C ","D ");
sub get_r_tags($a) { my @b = (); for(1..$a) { push @b, @tags[rand(@tags)]; } return @b; }
say get_r_tags(3);