Perl

These links are old sorry...

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
CodeMeaningAssociativity
( ) " ' `Parentheses (groups), quotes(string), FunctionsLEFT
->DereferenceLEFT
++ -Increment / DecrementNONE
**ExponentialRIGHT
! ~ \ unary + -Not ( logical and binary ) Escape, sign operatorsRIGHT
=~ !~Bind , Not BindLEFT
* / %Multiply Divide ModulusLEFT
xString MultiplyLEFT
+ -Add, MinusLEFT
.String ConcatenateLEFT
<< >>Binary shift left and rightLEFT
< > <= >=Numaric Comparison:
less than, greater than
less than or equal to, greater than or equal to
NONE
lt gt le geString Comparison:
less than, greater than
less than or equal to, greater than or equal to
NONE
== != <=>Numeric comparison: equal to, not equal to, compareNONE
eq ne cmpString comparison: equal to, not equal to, compareNONE
&Binary ANDLEFT
| ^Binary OR, exclusive ORLEFT
&&Logical ANDLEFT
||Logical ORLEFT
?:(Condition)? True : FalseRIGHT
= += -= *= /= %= x=
<<= >>= &= |= ^= &&= ||=
Compound assignment statementsLEFT
, =>Comma, right arrowLEFT
notLogical NOTRIGHT
andLogical ANDLEFT
or , xorLogical OR, Logical exclusive ORLEFT

Scalar Variables
CodeMeaning
" or qqBegins or ends a character string. Allows Variable Interpolation
' or qBegins or ends a character string. Does NOT allow Variable Interpolation
` or qxBegins or ends a system commant string. Allows Variable Interpolation
qwQuoted String. Does NOT allow Variable Interpolation

Numeric Formats
TYPEFORMATEXAMPLE
IntegerNN12
Floating PointNN.NN342.176
ScientificNN.NNENN42.04E-6
Big NumberNN_NNN_NNN6_000_000
Hexadecimal0xNNN0xFFD3
Octal0NNN0374

Reference Assignments
Data TypeOperatorExample
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 TypeOperatorExample
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
OperatorExampleMeaning
+$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
CodeMeaningNumberic Equivalent
.Concatenate+
xMultiply*
eqEqual To=
neNot Equal To!=
ltLess Than<
gtGreater Than>
leLess Than or Equal To<=
cmpCompare<=>

No comments:

Post a Comment