I love PERL..
perl.com
A great place for scripts !
Extropia.com
Matt's Free Perl CGI Scripts
Perl.jann.com
CGI Made Really Easy
Mastering Perl 5
$Bill's Free Website
Perl.com
Perl.org
The Perl Journal
Custom Perl applications for your intranet and web site
Matt's Script Archive
cgi-resources
activestate
Cliff's Perl Scripts
Roth Consulting's Perl Page
Perl Scripts
Gossamer Threads' website
Perl CGI Scripts
sunnyscript
perlreference.com
DCScripts?
Perl for Win32(FAQ) Why ?
Scriptkeeper.com
perl - Practical Extraction and Report Language
cgi-world
http://www.cgi.tj/
http://jenda.krynicky.cz/ Perl Mods
Perl Man Pages
Perl2exe
Cheat Sheet
<Script Language="perlscript"> $window->document->write("Hello This is a Perl Script Example"); </Script> | Of Course this hardly ever works for me online So I stick to perl files | |
Operators & Context | ||
Code | Meaning | Associativity |
( ) " ' ` | Parentheses (groups), quotes(string), Functions | LEFT |
-> | Dereference | LEFT |
++ - | Increment / Decrement | NONE |
** | Exponential | RIGHT |
! ~ \ unary + - | Not ( logical and binary ) Escape, sign operators | RIGHT |
=~ !~ | Bind , Not Bind | LEFT |
* / % | Multiply Divide Modulus | LEFT |
x | String Multiply | LEFT |
+ - | Add, Minus | LEFT |
. | String Concatenate | LEFT |
<< >> | Binary shift left and right | LEFT |
< > <= >= | Numaric Comparison: less than, greater than less than or equal to, greater than or equal to | NONE |
lt gt le ge | String Comparison: less than, greater than less than or equal to, greater than or equal to | NONE |
== != <=> | Numeric comparison: equal to, not equal to, compare | NONE |
eq ne cmp | String comparison: equal to, not equal to, compare | NONE |
& | Binary AND | LEFT |
| ^ | Binary OR, exclusive OR | LEFT |
&& | Logical AND | LEFT |
|| | Logical OR | LEFT |
?: | (Condition)? True : False | RIGHT |
= += -= *= /= %= x= <<= >>= &= |= ^= &&= ||= | Compound assignment statements | LEFT |
, => | Comma, right arrow | LEFT |
not | Logical NOT | RIGHT |
and | Logical AND | LEFT |
or , xor | Logical OR, Logical exclusive OR | LEFT |
Scalar Variables | |
Code | Meaning |
" or qq | Begins or ends a character string. Allows Variable Interpolation |
' or q | Begins or ends a character string. Does NOT allow Variable Interpolation |
` or qx | Begins or ends a system commant string. Allows Variable Interpolation |
qw | Quoted String. Does NOT allow Variable Interpolation |
Numeric Formats | ||
TYPE | FORMAT | EXAMPLE |
Integer | NN | 12 |
Floating Point | NN.NN | 342.176 |
Scientific | NN.NNENN | 42.04E-6 |
Big Number | NN_NNN_NNN | 6_000_000 |
Hexadecimal | 0xNNN | 0xFFD3 |
Octal | 0NNN | 0374 |
Reference Assignments | ||
Data Type | Operator | Example |
Scalar | \$var | $car=\$Porsche; |
Array | \@array | $allStores{$number}=\@storeInventory; |
Hash | \%hash | $storeType = \%stores; |
File Handle | \*FILEHANDLE | $inputReference = \*STDIN; |
Constant | \literal | $pi = \3.414; ( and a Great Movie by the way) |
Subroutine | \&subRoutine | $callBack = \&numericSort; |
Symbolic | \$variableName | $var = "var2"; $var2Ref = \$var; |
DeReference operators | ||
Data Type | Operator | Example |
Scalar | $$reference | $ref = $name; print "$$ref"; |
Array | @$reference | $arrayRef = \@array; print "@$arrayRef"; |
Array scalar | $$reference[index] | $ref =\@digits; $nine = $$ref[9]; |
Array Index | $#$reference | $ref =\@digits; $lastIndex = $#$ref; |
Hash | %$reference | $ref = %inventory; ($item, $cost) = each %$ref; |
Hash scalar | $$reference | $ref = %inventory; $itemCost = $$ref{'BrandX 16oz.'}; |
Basic Operators | ||
Operator | Example | Meaning |
+ | $a = 3 + 4; | Adds the expression on the left to expression on the right |
- | $a = 3 - 4; | Subtracts the expression on the right from the expression on the left |
* | $a = 3 * 4; | Multiply the expression on the left by the expression on the right |
/ | $a = 3 / 4; | Divides the expression on the left by the expression on the right |
** | $a = 2 ** 4; | Raises the expression on the left to the power of the expression on the right |
% | $a = 36 % 8; | Modulo the expression on the left by the expression on the right |
Compound Operators | ||
+= | $a += 3; | Adds the expression on the left to expression on the right |
-= | $a -= 3; | Subtracts the expression on the right from the expression on the left |
*= | $a *= 3; | Multiply the expression on the left by the right |
&= | $a &= 3; | Binary AND the expression on the left by the right |
|= | $a |= 3; | Binary OR the expression on the left by the left |
^= | $a ^= 3; | Exclusive OR the expression on the left with the one on the right |
<<= | $a <<= 3; | Left Shift the expression on the left by the one on the right |
>>= | $a >>= 3; | Right Shift the expression on the left by the one on the right |
&&= | $a &&= 1; | Logical AND the expression on the right with the one on the left |
||= | $a ||= 0; | Logical OR the expression on the left by the one on the right |
Increment & Decrement Operators | ||
++ | $a++; | Increment the scalar varable by one |
- | -$a; | Decrement the scalar varable by one |
Boolean Operators | ||
== | $a == 4; | Equal to - otherwise result is null |
!= | $a != 4; | Not Equal To - otherwise result is null |
< | $a < 4; | Less Than - otherwise result is null |
> | $a > 4; | Greater Than - otherwise result is null |
>= | $a >= 4; | Greater Than or Equal to- otherwise result is null |
<= | $a <= 4; | Less than or Equal to - otherwise result is null |
<=> | $a <=> 4; | Compare - otherwise result is null |
String operators | ||
Code | Meaning | Numberic Equivalent |
. | Concatenate | + |
x | Multiply | * |
eq | Equal To | = |
ne | Not Equal To | != |
lt | Less Than | < |
gt | Greater Than | > |
le | Less Than or Equal To | <= |
cmp | Compare | <=> |
No comments:
Post a Comment