Perl 6 cheat sheet v1 Based on the Perl 5 cheetsheet by Juerd Waalboer . CONTEXTS SIGILS ARRAYS HASHES void $scalar whole: @array %hash scalar @array slice: @array[0, 2] %hash{'a', 'b'} list %hash element: @array[0] %hash{'a'} &sub SCALAR VALUES number, string, reference, undef REFERENCES \ references @{$foo}[1] aka $foo.[1] $@%& dereference %{$foo}{bar} aka $foo.{bar} [] anon. arrayref @{@{$foo}[1]}[2] aka $foo.[1].[2] {} anon. hashref @{@{$foo}[1]}[2] aka $foo[1][2] \() list of refs NUMBERS vs STRINGS LINKS OPERATOR PRECEDENCE = = perl.plover.com + ~ search.cpan.org ++ -- == != eq ne cpan.org ** < > <= >= lt gt le ge pm.org ! u^ \ u+ u- ? u~ <=> cmp tpj.com ~~ !~ perldoc.com * / % x xx SYNTAX + - ~ for LIST { }, loop (a;b;c) { } .<< .>> +<< ~<< etc. while EXPR { }, until ( ) { } named uops if EXPR { } elsif EXPR { } else { } & unless EXPR { } elsif EXPR { } else { } |^ < > <= >= lt gt le ge == != <=> eq ne cmp && REGEX METACHARS REGEX MODIFIERS || ^^ // ^ string begin :i case insens. $ string end :w skip w/space .. + one or more :e each ?? :: * zero or more = += -= *= etc. ? zero or one , () capture list ops [] no capture REGEX CHARCLASSES not <[]> character class . == any char and | alternation \s == [\x20\f\t\r\n] or xor err <1,2> repeat in range \w == [A-Za-z0-9_] \b word boundary \d == [0-9] \S, \W and \D negate DO use strict; DON'T LINKS use warnings; "$foo" perl.com my $var; $$variable_name perlmonks.org open() err die $!; `$userinput` use.perl.org use Modules; /$userinput/ perl.apache.org parrotcode.org FUNCTION RETURN OBJECT ELEMENTS stat localtime caller SPECIAL VARIABLES 0 dev 0 second 0 package $_ current topic 1 ino 1 minute 1 filename $0 regex result 2 mode 2 hour 2 line 3 nlink 3 day 3 subroutine 4 uid 4 month-1 4 hasargs 5 gid 5 year-1900 5 want $! error object 6 rdev 6 weekday 6 evaltext 7 size 7 yearday 7 is_require 8 atime 8 is_dst 8 hints 9 mtime 9 bitmask @ARGS command line args 10 ctime @INC include paths 11 blksz @_ subroutine args 12 blcks %ENV environment