Documente Academic
Documente Profesional
Documente Cultură
* either the entry doesn't exist in the language, and please tell so. The entry will be marked as such
and won't appear as missing anymore.
* Various
{ ... }(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 (until end of line)
< > <= >= comparison
lt gt le ge comparison
min minstr / max maxstr(2) comparison (min / max (binary or more))
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
* Functions
* Control Flow
my %case = (
v1 => sub { ... },
v2 => sub { ... },
);
if ($case{val}) { $case{val}->() } else { ... }
use Switch;
switch ($val) {
case v1 { ... }
case v2 { ... }
else ...
})
* Package, Module
package p; declare
@ISA = qw(Exporter); @EXPORT = qw(name1 name2 ...); declare (selective export)
use p(9) import (everything into current namespace)
use p;(10) import (package (ie. load the package))
require p import (package (ie. load the package))
use p qw(name1 name2 ...) import (selectively)
:: package scope
' package scope
* Strings
* Booleans
(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)
t computable tuple (these are a kind of immutable lists playing a special role in parameter
passing) (using a tuple for a function call)
$h{k} dictionary (access: read/write)
{ a => b, c => d } dictionary (constructor)
{ a, b, c, d } dictionary (constructor)
exists $h{k} dictionary (has the key ?)
keys dictionary (list of keys)
values dictionary (list of values)
(%h1, %h2)(15) dictionary (merge)
delete $h{k} dictionary (remove by key)
undef optional value (null value)
v optional value (value)
v optional value (value)
a .. b range (inclusive .. inclusive)
\ reference (pointer) (creation)
$ @ % &(16) reference (pointer) (dereference)
->[...] ->{...} ->(...)(17) reference (pointer) (dereference)
( a, b, c ) tuple constructor
* Mathematics
0b1, 07, 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(19) trigonometry (inverse)
int / / floor / ceil truncate / round / floor / ceil
Remarks
Pixel
This document is licensed under GFDL (GNU Free Documentation License).
Generated from syntax-across-languages.html.pl
$Id: syntax-across-languages.html.pl 408 2008-08-29 08:32:23Z pixel $
robert
adhi
kusuma
putra
robert
adhi
kusuma
putra
robert
adhi
kusuma
putra
robert
adhi
kusuma
putra