The Perl Cheat sheet

Reviews
Shared by: armani11
Categories
Stats
views:
61
rating:
not rated
reviews:
0
posted:
11/9/2008
language:
English
pages:
0
The Perl Cheat sheet CONTEXTS void scalar list SIGILS $scalar @array %hash &sub *glob ARRAYS whole: @array slice: @array[0, 2] element: $array[0] HASHES %hash @hash{’a’, ’b’} $hash{’a’} SCALAR VALUES number, string, reference, glob, undef $$foo[1] $$foo{bar} ${$$foo[1]}[2] ${$$foo[1]}[2] aka aka aka aka $foo->[1] $foo->{bar} $foo->[1]->[2] $foo->[1][2] REFERENCES \ references $@%&* dereference [] anon. arrayref {} anon. hashref \() list of refs NUMBERS vs STRINGS OPERATOR PRECEDENCE = = -> + . ++ -== != eq ne ** < > <= >= lt gt le ge ! ~ \ u+ u<=> cmp =~ !~ * / % x SYNTAX + - . for (LIST) { }, for (a;b;c) { } << >> while ( ) { }, until ( ) { } named uops if ( ) { } elsif ( ) { } else { } < > <= >= lt gt le ge unless ( ) { } elsif ( ) { } else { } == != <=> eq ne cmp for equals foreach (ALWAYS) & | ^ REGEX METACHARS REGEX MODIFIERS && ^ string begin /i case insens. || $ str. end (before \n) /m line based ^$ .. ... + one or more /s . includes \n ?: * zero or more /x ign. wh.space = += -= *= etc. ? zero or one /g global , => {3,7} repeat in range list ops () capture REGEX CHARCLASSES not (?:) no capture . == [^\n] and [] character class \s == [\x20\f\t\r\n] or xor | alternation \w == [A-Za-z0-9_] \b word boundary \d == [0-9] \z string end \S, \W and \D negate SPECIAL VARIABLES $_ default variable $0 program name $/ input separator $\ output separator $| autoflush $! sys/libcall error $@ eval error $$ $. @ARGV @INC @_ %ENV process ID line number command line args include paths subroutine args environment Perl Cheat Sheet Operator Precedence left left right right left left left left terms and list operators (leftward) -> ** ! ~ \ and unary + and =~ !~ */%x +-. << >> nonassoc ++ -- nonassoc named unary operators nonassoc < > <= >= lt gt le ge nonassoc == != <=> eq ne cmp left left left left right right left right left left & |^ && || ?: = += -= *= etc. , => not and or xor nonassoc .. ... nonassoc list operators (rightward)

Related docs
The Perl Cheat sheet
Views: 4  |  Downloads: 4
Perl Pack Unpack Printf Sprintf Cheat Sheet Summary
Views: 1893  |  Downloads: 20
Lab 1 The Basics of Text Processing in Perl
Views: 0  |  Downloads: 0
10stripe's Perl Cheat-Sheet
Views: 1  |  Downloads: 1
Google Cheat Sheet
Views: 486  |  Downloads: 111
premium docs
Other docs by armani11
pro-vehicle-mileage
Views: 232  |  Downloads: 14
Credit-Collection Letter Pleasant
Views: 509  |  Downloads: 9
0707 Inst SS-4 (PDF) Instructions
Views: 404  |  Downloads: 5
Authorization (Proxy) To Vote Shares
Views: 339  |  Downloads: 6
DAY PLANNER
Views: 825  |  Downloads: 88
Nominating and Corporate Governance Charter
Views: 184  |  Downloads: 3
Form 4684 Casualties and Thefts
Views: 334  |  Downloads: 5
Corio Inc Ammendments and By laws
Views: 237  |  Downloads: 0
CorpDocs-Board First Meeting Minutes California
Views: 396  |  Downloads: 18
Sample Action by Voting Members or Managers
Views: 229  |  Downloads: 1