Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Here's a first draft of the equivalent Perl 6 cheatsheet. I have deliberately restricted it to the same topics. Notice how similar to the Perl 5 version most of it is?
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

In reply to Perl 6 version of cheatsheet by TheDamian
in thread perlcheat by Juerd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (12)
    As of 2014-07-11 15:32 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (230 votes), past polls