The "Unknown:"s below indicate that an entry is incomplete.
{ ... }(1) | block (grouping statements, especially when statements are not expressions) |
nothing needed | breaking lines (useful when end-of-line and/or indentation has a special meaning) |
#[ ... ] | commenting (nestable) |
# | commenting (until end of line) |
< > <= >= | comparison |
lt gt le ge | comparison |
a <=> b | comparison (returns 3 values (i.e. inferior, equal or superior)) |
cmp | comparison (returns 3 values (i.e. inferior, equal or superior)) |
=pod ... =cut(2) | documentation comment |
eqv | equality / inequality (deep) |
== != | equality / inequality (shallow) |
=== !== | equality / inequality (shallow) |
incremental garbage collection => not needed | force garbage collection |
( ... ) | grouping expressions |
$?LINE $?FILE | information about the current line and file |
eval | runtime evaluation |
case-sensitive | tokens (case-sensitivity (keywords, variable identifiers...)) |
[_a-zA-Z0-9]+ | tokens (variable identifier regexp) |
CamelCase for modules, ALL_CAPS for constants, unclear for functions / variables | tokens (what is the standard way for scrunching together multiple words) |
do | use a block as a return value (when statements are not expressions) |
= | variable assignment or declaration (assignment) |
my / our / temp | variable assignment or declaration (declaration) |
Unknown:
comparison (min / max (binary or more))
&f.assuming(var_name => a) | partial application (in the examples below, a normal call is "f(a,b)") (give the first argument) |
&f.assuming(b => b) | partial application (in the examples below, a normal call is "f(a,b)") (give the second argument) |
-> $a, $b { ... } | anonymous function |
f(a,b,...) | function call |
$f.(a,b,...) | function call |
f | function call (with no parameter) |
$f.() | function call (with no parameter) |
AUTOSCALAR, AUTOMETH, AUTOLOAD... | function called when a function is not defined (in dynamic languages) |
sub f { ... } | function definition |
sub f($para1, $para2, ...) { ... } | function definition |
return(3) | function return value (breaks the control flow) |
no syntax needed(4) | function return value (function body is the result) |
caller | runtime inspecting the caller information |
next / last | breaking control flow (continue / break) |
redo/ | breaking control flow (redo / retry) |
return(3) | breaking control flow (returning a value) |
try { a CATCH exn { ... } } | exception (catching) |
die | exception (throwing) |
if c {...} | if_then |
c ?? b1 !! b2 | if_then_else |
do ... until c | loop (do something until condition) |
loop | loop (for "a la C" (while + initialisation)) |
loop (my $i = 10; $i >= 1; $i--) { ... } | loop (for each value in a numeric range, 1 decrement) |
for (1 .. 10) -> $i { ... } | loop (for each value in a numeric range, 1 increment (see also the entries about ranges)) |
loop (my $i = 1; $i <= 10; $i += 2) { ... } | loop (for each value in a numeric range, free increment) |
loop | loop (forever loop) |
while c ... | loop (while condition do something) |
given $val { when v1 { ... } when v2 { ... } default { ... } } | multiple selection (switch) |
; | sequence |
Unknown:
breaking control flow (goto (unconditional jump))
t v | annotation (or variable declaration) |
Unknown:
declaration
cast
mutability, constness (type of a mutable value)
mutability, constness (type of a constant value)
$o.SUPER::method(...) | accessing parent method |
class | class declaration |
. | current instance |
meta | get the type/class corresponding to an object/instance/value |
can | has the method |
class child is parent { ... } | inheritance |
object.method(para) | method invocation |
object.method | method invocation (with no parameter) |
o.meta.getmethods | methods available |
o.clone | object cloning |
class_name.new(...) | object creation |
o.meta.isa | testing class membership |
Unknown:
manually call an object's destructor
Unknown:
package scope
declare
import
chr | ascii to character |
ord | character to ascii |
Char | character type name |
perl | convert something to a string (see also string interpolation) |
"" ~ e | convert something to a string (see also string interpolation) |
x | duplicate n times |
substr | extract a substring |
index | locate a substring |
rindex | locate a substring (starting at the end) |
all strings allow multi-line strings | multi-line |
simple print (on simple objects) | |
say(5) | simple print (on simple objects) |
sprintf | sprintf-like |
~ | string concatenation |
eq ne | string equality & inequality |
bytes chars | string size |
"\n" | strings (end-of-line (without writing the real CR or LF character)) |
"... $v ..." | strings (with interpolation of variables) |
qq(...(... $v ...)...), qq[...], qq{...}, qq<...>, qq/.../ | strings (with interpolation of variables) |
'...' | strings (with no interpolation of variables) |
q(...(...)...), q[...], q{...}, q<...>, q/.../ | strings (with no interpolation of variables) |
Str | type name |
uc / lc | upper / lower case character |
uc / lc | uppercase / lowercase / capitalized string |
Unknown:
serialize (marshalling)
unserialize (un-marshalling)
undef | false value |
0(6) | false value |
"" | false value |
"0" | false value |
() | false value |
! | logical not |
not(7) | logical not |
?| / | logical or / and (non short circuit (always evaluates both arguments)) |
|| / && | logical or / and (short circuit) |
or / and | logical or / and (short circuit) |
anything not false | true value |
Bool | type name |
unshift | adding an element at the beginning (list cons) (side-effect) |
push | adding an element at the end (side-effect) |
reduce(8) | f(... f(f(init, e1), e2) ..., en) |
shift | get the first element and remove it |
pop | get the last element and remove it |
join(s, l) | join a list of strings in a string using a glue string |
l.join(s) | join a list of strings in a string using a glue string |
grep | keep elements (matching) |
[ a, b, c ](9) | list constructor |
( a, b, c ) | list constructor |
zip | list of couples from 2 lists |
elems | list size |
a[i] | list/array indexing |
uniq | remove duplicates |
reverse | reverse |
min / max | smallest / biggest element |
sort(10) | sort |
Array or List | type name |
Unknown:
list concatenation
list flattening
adding an element at index
first element
all but the first element
last element
for each element do something
transform a list (or bag) in another one
transform two lists in parallel
find an element
is an element in the list
is the predicate true for an element
is the predicate true for every element
iterate with index
a, | computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (1-uple) |
() | computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (empty tuple) |
%h{k} or %h<s> | dictionary (access: read/write) |
{ a => b, c => d } | dictionary (constructor) |
exists | dictionary (has the key ?) |
keys | dictionary (list of keys) |
values | dictionary (list of values) |
delete | dictionary (remove by key) |
Hash | dictionary (type name) |
Unknown:
tuple type
tuple constructor
computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (using a tuple for a function call)
reference (pointer) (creation)
reference (pointer) (dereference)
optional value (null value)
optional value (value)
optional value (null coalescing)
record (type declaration)
record (selector)
union type declaration
enumerated type declaration
dictionary (merge)
range
+ / - / * / / | addition / subtraction / multiplication / division |
+& / +| / +^ | bitwise operators (and / or / xor) |
** | exponentiation (power) |
log10 | logarithm (base 10) |
log | logarithm (base e) |
% | modulo (modulo of -3 / 2 is 1) |
- | negation |
1000, 1000.0, 1E3(11) | numbers syntax (floating point) |
1_000, 10_00, 100_0 | numbers syntax (integer thousand-separator) |
0b1, 0o7, 0xf | numbers syntax (integers in base 2, octal and hexadecimal) |
1000 | numbers syntax (integers) |
mathematical | operator priorities and associativities (addition vs multiplication) |
mathematical | operator priorities and associativities (exponentiation vs negation (is -3^2 equal to 9 or -9)) |
rand | random (random number) |
srand | random (seed the pseudo random generator) |
sqrt / exp / abs | square root / e-exponential / absolute value |
sin / cos / tan | trigonometry (basic) |
asin / acos / atan(12) | trigonometry (inverse) |
truncate / round / floor / ceiling | truncate / round / floor / ceil |
Rat | type name (floating point) |
Int | type name (integers) |