on 2013-03-18 , other date:
print receives a string or a comma-separated list of strings as argument(s) and prints it.
;indicates end of statement.
=operator, assigns value.
+operator, addition.
on 2013-03-20 , other date:
-operator, substraction.
*operator, multiplication.
/operator, division.
**operator, exponentation (exponent.txt)
sqrt[sqrt EXPR] Returns the square root of EXPR. If EXPR is omitted, returns square root of $_ . Only works on non-negative operands.
.operator, concatenation.
%operator, modulus.
scalarsingle value data.
numberdata type.
stringdata type.
\backslash, allows for inserting some control characters, like new line (\n) or tab (\t), otherwise escapes special characters, like \@ , a quote (\") or the backslash character itself (\\)
STDINthe program's normal input channel.
STDOUTthe program's normal output channel.
STDERRan output channel for error messages.
<STDIN>used for reading data from standard input.
chop removes from argument last character of string.
chomp removes from argument last character of string if it is return.
perldocLook up Perl documentation in pod format. perldoc -f BuiltinFunction, perldoc -q FAQ Keyword
perl -hprints a summary of the options for running perl.
++operator, autoincrement 1.
--operator, autodecrement 1.
+=operator, autoincrement value.
-=operator, autodecrement value.
.=operator, autoconcatenate string.
{ }indicate start/end of block.
@arraydata structure, array.
scalar[scalar EXPR] Forces EXPR to be interpreted in scalar context and returns the value of EXPR. scalar @ary returns the number of elements in @ary.
$#array_namecontains the index value of the last element of @array_name.
foreachcontrol structure. (foreach00.txt, foreach01.txt, foreach02.txt)
sort receives a list of variables (or an array) and returns the sorted list. (sortreverse.txt)
reverseIn list context, returns a list value consisting of the elements of LIST in the opposite order. In scalar context, concatenates the elements of LIST and returns a string value with all characters in the opposite order. (sortreverse.txt)
push[push ARRAY,LIST] adds LIST to the end of a given array, and returns the new number of elements in the array.
printf [printf FILEHANDLE FORMAT, LIST] receives a string or a comma-separated list of strings as argument(s) and prints it according to format. (printf.txt)
on 2013-04-10 , other date:
@ARGVpredefined, contains data from command line. $ARGV[0] contains the first word from command line, $ARGV[1] the second ...
shiftShifts the first value of the array off and returns it, shortening the array by 1 and moving everything down.
unshift[unshift ARRAY,LIST] does the opposite of shift: prepends LIST to the front of the array, and returns the new number of elements in the array.
popPops and returns the last value of the array, shortening the array by one element.
qQuote operator. Adds single quotes around a string. Literal. Interpolates=NO. $a = q{Don't try this at home}; "{}" represents any pair of delimiters.
qqQuote operator. Adds double quotes around a string. Literal. Interpolates=YES. $a = qq{Please make it "hot".}; "{}" represents any pair of delimiters.
qwQuote-like operator. Takes a string as parameter and builds a quoted list. Word list. Interpolates=NO. @array = qw{red blue yellow}; "{}" represents any pair of delimiters
qxQuote-like operator. Adds back-quotes around a string. Command. Interpolates=YES. $a = qx{ ls -l /tmp}; "{}" represents any pair of delimiters.
subdeclares a subroutine, user defined function. (subroutine0.txt, subroutine1.txt, subroutine2.txt, subroutine3.txt, subroutine4.txt, subroutine5.txt)
my[my EXPR] A "my" declares the listed variables to be local (lexically) to the enclosing block, file, or "eval". (localmy.txt)
our[my EXPR] An "our" declaration declares a global variable that will be visible across its entire lexical scope, even across package boundaries.
local[local EXPR] A "local" modifies its listed variables to be "local" to the enclosing block, "eval", or "do FILE" and to any subroutine called from within that block. (localmy.txt)
on 2013-04-17 , other date:
length returns length of string.
pragmaA message written into the source code that tells the compiler to compile the program in some fashion that differs from the default method. For example, pragmas may alter the kinds of error messages that are generated or optimize the machine code in some way.
strict[use strict;] Perl pragma to restrict unsafe constructs. (strict.txt)
warnings[use warnings;] Perl pragma to control optional warnings. (warnings.txt)
diagnostics[use diagnostics;] Perl pragma to force verbose warning diagnostics. (diagnostics.txt)
constant[use constant ...;] Perl pragma to declare constants. (constant.txt)
ifcontrol structure.
elsifcontrol structure.
elsecontrol structure.
cmpString comparison, returning -1, 0, or 1. (sort.txt)
<=>Numeric comparison, returning -1, 0, or 1. (sort.txt)
==numeral comparison operator, equal to.
!=numeral comparison operator, not equal to.
<numeral comparison operator, less than.
>numeral comparison operator, greater than.
<=numeral comparison operator, less than or equal to.
>=numeral comparison operator, greater or equal to.
eqstring comparison operator, equal to.
nestring comparison operator, not equal to.
ltstring comparison operator, less than.
gtstring comparison operator, greater than.
lestring comparison operator, less than or equal to.
gestring comparison operator, greater or equal to.
ifThenElse [ (condition) ? true : false;] Compact if-then-else form. (ifThenElse.txt, plural.txt)
unlesscontrol structure.
whilecontrol structure. (controlStructure01.txt)
untilcontrol structure. (controlStructure02.txt)
docontrol structure. (controlStructure03.txt)
forcontrol structure. (controlStructure04.txt)
last The "last" command is like the "break" statement in C (as used in loops); it immediately exits the loop in question.
next The "next" command is like the "continue" statement in C; it starts the next iteration of the loop.
exit[exit EXPR] Evaluates EXPR and exits immediately with that value. If EXPR is omitted, exits with 0 status.
orWorks on numbers and strings. Returns 1 (true) if either of the two operands is true, and null (false) otherwise.
||Symbolic or. Works on numbers and strings. Returns the value of the true operand if either of the two operands is true, and null (false) otherwise. (symbolicOR.txt )
||=Assignment symbolic or. Works on numbers and strings. Is a combination of assignment and or operators. Left side variable gets value of right side if left side is false, otherwise keep its own value.
andWorks on numbers and strings. Returns 1 (true) if both operands are true or null (false) otherwise.
notWorks on numbers and strings. Returns 1 (true) if the operand is false and null (false) otherwise.
!Symbolic not.
on 2013-04-22 , other date:
map[map BLOCK LIST; map EXPR,LIST] Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each element) and returns the list value composed of the results of each such evaluation. (map.txt)
defined [defined EXPR] Returns a Boolean value telling whether EXPR has a value other than the undefined value "undef".
wantarrayReturns true if the context of the currently executing subroutine is looking for a list value. Returns false if the context is looking for a scalar. Returns the undefined value if the context is looking for no value (void context). (wantarray.txt)
sleep[sleep EXPR] Causes the script to sleep for EXPR seconds, or forever if no EXPR.
$|[$OUTPUT_AUTOFLUSH] filehandle buffered mode flag. (flush01.txt, flush02.txt)
English[use English;] Provides aliases for the built-in variables whose names no one seems to like to read. See the perldoc perlvar pages for a complete list of aliases.
redo The "redo" command restarts the block. (loopRedo.txt)
rand [rand EXPR] Returns a random fractional number greater than or equal to "0" and less than the value of EXPR. (rand.txt )
srand [srand EXPR] Sets the random number seed for the "rand" operator. If srand() is not called explicitly, it is called implicitly at the first use of the "rand" operator.
require[require EXPR] Demands that a library file as named on EXPR be included if it hasn't already been included. (onePiece.txt, require.txt, library.txt )
lib[use lib LIST;no lib LIST;] Manipulate @INC at compile time. It is typically used to add extra directories to perl's search path so that later "use" or "require" statements will find modules which are not located on perl's default search path. (require01.txt, require02.txt, require03.txt)
sprintf [sprintf FORMAT, LIST] returns a string formatted by the usual `printf' conventions.
File::Basename[module] Routines that allow to parse file specifications into useful pieces using the syntax of different operating systems. (basename.txt)
File::Path[module] create or remove directory trees. (filePath.txt)
FindBin[module] Locate directory of original perl script. (findbin.txt)
File::Spec::Functions[module] Portably perform operations on file names (some functions: canonpath, catdir, catfile, file_name_is_absolute, path). For a full reference of available functions, please consult the File::Spec::Unix manpage
File::Slurp[module] Reading/Writing/Modifying of Complete Files. (fileSlurp.txt)
on 2013-04-29 , other date:
substr [substr EXPR,OFFSET,LENGTH,REPLACEMENT] extracts a substring out of a string and returns it. The function receives 3 arguments. A string value, a position on the string (starting to count from 0) and a length. (substr1.txt, substr2.txt, substr3.txt )
join [join EXPR,LIST] joins the separate strings of LIST into a single string with fields separated by the value of EXPR, and returns that new string. (join.txt)
split [split /PATTERN/,EXPR,LIMIT] splits a string into a list of strings and returns that list. (split1.txt, split2.txt)
index [index STR,SUBSTR,POSITION] searches for one string within another. (index.txt)
open [open FILEHANDLE,EXPR] opens a file or device and associates it with a filehandle. (foreach.txt, while.txt, p53.seq)
close [close FILEHANDLE] closes the file or device associated with the filehandle. (while.txt, p53.seq)
die prints the value of LIST to `STDERR' and exits with the current value of `$!' (die.txt)
warn produces a message on STDERR just like `die', but doesn't exit or throw an exception.
$>[$EUID $EFFECTIVE_USER_ID] The effective uid of this process. (userinfo.txt)
$<[$UID $REAL_USER_ID] The real uid of this process. (userinfo.txt)
getpwuidreturns user name from userid, as in $name = getpwuid($EUID).
Also ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell,$expire) = getpwuid($EUID). (userinfo.txt)
$0[$PROGRAM_NAME] name of current script (userinfo.txt)
file test -rFile is readable by effective uid/gid.
file test -wFile is writable by effective uid/gid.
file test -xFile is executable by effective uid/gid.
file test -RFile is readable by real uid/gid.
file test -XFile is executable by real uid/gid.
file test -OFile is owned by real uid.
file test -eFile exists.
file test -zFile has zero size.
file test -sFile has non-zero size (returns size).
file test -fFile is a plain file.
file test -dFile is a directory.
file test -lFile is a symbolic link.
file test -pFile is a named pipe (FIFO).
file test -SFile is a socket.
file test -bFile is a block special file.
file test -cFile is a character special file.
file test -uFile has setuid bit set.
file test -gFile has setgid bit set.
file test -kFile has sticky bit set.
file test -tFilehandle is opened to a tty.
file test -TFile is a text file.
file test -BFile is a binary file (opposite of -T).
file test -MAge of file in days when script started.
file test -AAge of file in days since last access.
file test -CAge of file in days since last inode change time.
glob [glob EXPR] Returns the value of EXPR with filename expansions such as the standard Unix shell /bin/csh would do. (glob.txt)
__DATA__The __DATA__ token tells the perl compiler that the perl code for compilation is finished. Everything after the __DATA__ token is available for reading via the filehandle FOOBAR::DATA, where FOOBAR is the name of the current package when the __DATA__ token is reached. (data.txt)
on 2013-05-06 , other date:
$/[$RS $INPUT_RECORD_SEPARATOR] The input record separator, newline by default. (recordseparator.txt)
$.[$NR $INPUT_LINE_NUMBER] The current input record number for the last file handle from which you just read(). (recordseparator.txt)
opendir[opendir DIRHANDLE,EXPR] Opens a directory named EXPR for processing by "readdir" and "closedir". Returns true if successful. (readdir.txt)
readdir[readdir DIRHANDLE] Returns the next directory entry for a directory opened by "opendir". If used in list context, returns all the rest of the entries in the directory. If there are no more entries, returns an undefined value in scalar context or a null list in list context. (readdir.txt)
closedir[closedir DIRHANDLE] Closes a directory opened by "opendir" and returns the success of that system call. (readdir.txt)
read [read FILEHANDLE,SCALAR,LENGTH] Attempts to read LENGTH bytes of data into variable SCALAR from the specified FILEHANDLE. Returns the number of bytes actually read, "0" at end of file, or undef if there was an error. (read.txt)
seek [seek FILEHANDLE,POSITION,WHENCE] Sets FILEHANDLE's position, The values for WHENCE are 0 to set the new position in bytes to POSITION, 1 to set it to the current position plus POSITION, and 2 to set it to EOF plus POSITION.
stat[stat FILEHANDLE][stat EXPR] Returns a 13-element list giving the status info for a file, either the file opened via FILEHANDLE, or named by EXPR.
Example ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
%hashdata structure (hash01.txt, hash.txt, countTissues)
keysReturns a list consisting of all the keys of the named hash. In scalar context, returns the number of keys. (keys.txt, hash.txt)
valuesReturns a list consisting of all the values of the named hash. In a scalar context, returns the number of values. (values.txt, hash.txt)
eachWhen called in list context, returns a 2-element list consisting of the key and value for the next element of a hash, so that you can iterate over it. When called in scalar context, returns only the key for the next element in the hash. (hash.txt)
=>the => operator is just a synonym for a comma. (hash.txt)
delete [delete EXPR] Given an expression that specifies a hash element, array element, hash slice, or array slice, deletes the specified element(s) from the hash or array. (hash.txt, delete.txt)
undef[undef EXPR] Undefines the value of EXPR. Always returns the undefined value. (defined.txt)
exists[exists EXPR] Given an expression that specifies a hash element or array element, returns true if the specified element in the hash or array has ever been initialized, even if the corresponding value is undefined. (codon.txt)
on 2013-05-13 , other date:
factorialcompares iteration and recursion (fact_iteration.txt, fact_recursion.txt)
Fibonaccicomputes the series 0 1 1 2 3 5 8 .. (fibo1.txt, fibo2.txt)
referenceA reference is a scalar value that refers to an entire array or an entire hash (or to just about anything else). (ref_sample.txt, ref_array0.txt, ref_array1.txt)
ref[ref EXPR] Returns a true value if EXPR is a reference, false otherwise. If EXPR is not specified, "$_" will be used. The value returned depends on the type of thing the reference is a reference to. Builtin types include: SCALAR, ARRAY, HASH, CODE, REF, GLOB, LVALUE. (ref_hash.txt, ref_hash2.txt, ref_sub.txt)
Data::Dumper[module] stringified perl data structures, suitable for both printing and "eval" (datadumper.txt, dataDumperDumper.txt, dataDumperReader.txt, dataDumperReader2.txt)
do[do EXPR] Uses the value of EXPR as a filename and executes the contents of the file as a Perl script. (do.txt)
eval[eval EXPR, eval BLOCK] In the first form, the return value of EXPR is parsed and executed as if it were a little Perl program. In the second form, the code within the BLOCK is parsed only once (at the same time the code surrounding the eval itself was parsed) and executed within the context of the current Perl program. (eval.txt)
on 2013-05-20 , other date:
regular expressionssee http://biocourse.weizmann.ac.il/course/prog/regexps/regexps.html (match.txt, sp_list.txt, matchSet.txt, gotamatch1.html)
=~Pattern binding operator. The left operand is the string to be searched. The right operand is a pattern-match operation (search, substitute, translate) (DNAtoRNA.txt, reverseComplement.txt, trimSpaces1.txt, trimSpaces2.txt, trimSpaces3.txt)
$`,$&,$'[$PREMATCH,$MATCH,$POSTMATCH] before, hit, after (match01.txt, match02.txt, match03.txt)
tr[tr/SEARCHLIST/REPLACEMENTLIST/d] Transliterates all occurrences of the characters found in the search list with the corresponding character in the replacement list. It returns the number of characters replaced or deleted.
m[m/PATTERN/cgimosx;] Searches a string for a pattern match, and in scalar context returns true (1) or false (''). (match04.txt)
pos[pos SCALAR] Returns the offset of where the last "m//g" search left off for the variable in question ($_ is used when the variable is not specified). (match04.txt)
s[s/SEARCHpattern/REPLACEMENTpattern/modifier;] Replaces SEARCHpattern by REPLACEMENTpattern. Modifiers are 'i' for case insensitive search, 'g' for global replacement.
on 2013-05-27 , other date:
YAML::Any[module] implements the YAML human-readable data serialization format. (yaml1.txt, yaml2.txt)
Storable[module] persistence for Perl data structures (storable.txt)
DB_File[module] access to Berkeley DB version 1.x (dbfile.txt)
GDBM::File[module] allows access to the gdbm library. see http://biocourse.weizmann.ac.il/course/prog/dbm/GDBM.html (gdbmfile.txt, phonesGDBM.txt)
dbmopen [dbmopen HASH,DBNAME,MASK] This binds a dbm(3), ndbm(3), sdbm(3), gdbm(3), or Berkeley DB file to a hash. (dbmCreate.txt, dbmRead.txt, phones.txt )
dbmclose [dbmclose HASH] Breaks the binding between a DBM file and a hash. (dbmCreate.txt, dbmRead.txt, phones.txt)
content-type: text/htmlheader describing the document MIME type, required by web browsers (mime_type.txt )
REMOTE_ADDR[$ENV{"REMOTE_ADDR"}] IP address of client computer (env.txt)
PATH[$ENV{"PATH"}] Lists the set of directories where the operating system will search in order to find and execute a command. (path.txt )
CGI[module] Simple Common Gateway Interface Class (cgi_submit.gif, cgi01.txt, cgiSend.txt, cgiReceive.txt)
CGI errors[use CGI::Carp 'fatalsToBrowser';] Sends runtime errors to browser's screen. Useful for debugging purposes.
HTML FormsAn HTML form is a section of a document containing normal content, markup, special elements called controls (checkboxes, radio buttons, menus, etc.), and labels on those controls. Users generally "complete" a form by modifying its controls (entering text, selecting menu items, etc.), before submitting the form to an agent for processing (e.g., to a Web server, to a mail server, etc.) (forms01.txt, forms02.txt, forms03.txt, forms04.txt, forms05.txt, forms06.txt, forms07.txt)
HTML Examples(created by Moshe Kafri and Niv Antonovsky) (HTML_form/html_example-NA.txt, HTML_form/html_example-NA.html, HTML_form/example1-NA.cgi_txt)
CGI Dump[print $q->Dump();] CGI method. Produces a string consisting of all the query's name/value pairs formatted nicely as a nested list. Useful for debugging purposes.
CGI names[@names = $query->param;] fetching the names of all the parameters passed to the script. (cgiNames.txt)
CGI vars[%vars = $query->Vars;] fetchs the entire parameter list as a hash in which the keys are the names of the CGI parameters, and the values are the parameters' values. (cgiVars.txt)
POST, GET Methods in HTML Forms. The difference between METHOD="GET" (the default) and METHOD="POST" is primarily defined in terms of form data encoding. If the method is "get", the user agent takes the value of action, appends a ? to it, then appends the form data set, encoded using the application/x-www-form-urlencoded content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes. If the method is "post", the user agent conducts an HTTP post transaction using the value of the action attribute and a message created according to the content type specified by the enctype attribute.
on 2013-06-03 , other date:
Term::ReadLine[module] Front end to various 'readline' packages to ease data input (readline.txt)
File::Copy[module] provides two basic functions, "copy" and "move", which are useful for getting the contents of a file from one place to another. (filecopy.txt)
Time::Elapse[module] Perl extension for monitoring time during tasks (timeElapse.txt)
File::Temp[module] returns name and handle of a temporary file safely (fileTemp.txt)
Date::Calc[module] Gregorian calendar date calculations (datecalc.txt)
GD[module] Interface to Gd Graphics Library (gd.txt, gd.png)
GD::Graph[module] Graph Plotting Module (line.txt, line.png, line2.txt, line2.png, 2lines.txt, 2lines.png, area.txt, area.png, bars.txt, bars.png, 2bars.txt, 2bars.png, barsUpDown.txt, barsUpDown.png, pie.txt, pie.png, pie3D.txt, pie3D.png)
on 2013-06-10 , other date:
Data Structureshttp://biocourse.weizmann.ac.il/course/prog/dds
LWP::Simple[module] simplified view of the libwww-perl library. (lwp1.txt, lwp2.txt, lwp3.txt, getPDBfile.txt)
LWP::UserAgent[module] is a class implementing a World-Wide Web user agent in Perl. (lwpUserAgent.txt)
HTTP::Request::Common[module] constructs common HTTP::Request objects (httpRequest.txt)
HTML::LinkExtor[module] Extract links from an HTML document. (linkextor.txt)
URI[module] Manages Uniform Resource Identifiers. A Uniform Resource Identifier is a compact string of characters for identifying an abstract or physical resource. (linkextor.txt)
URI::Escape[module] Escape and unescape unsafe characters. (uriescape.txt)
WWW::Mechanize[module] helps automate interaction with a website. It supports performing a sequence of page fetches including following links and submitting forms. Each fetched page is parsed and its links and forms are extracted. A link or a form can be selected, form fields can be filled and the next page can be fetched. Mech also stores a history of the URLs you've visited, which can be queried and revisited. (mechanize.txt)
packageDefines a namespace. Default namespace is main (package1.txt, subroutineCall.txt)
on 2013-06-17 , other date:
binmode [binmode FILEHANDLE] Arranges for FILEHANDLE to be read or written in "binary" mode. Regardless of platform, use binmode() on binary data, like for example images.
backtick[$output = `program`] Executes program. Mainly used to capture program's output. (backtick1.txt, backtick2.txt)
exec[exec PROGRAM LIST] The "exec" function executes a system command and never returns
system[system PROGRAM LIST] Does exactly the same thing as `exec LIST', except that a fork is done first, and the parent process waits for the child process to complete.
OPEN (piped)[open FILEHANDLE,MODE,LIST] (see open above for a general description) If MODE is "'|'", the filename is interpreted as a command to which output is to be piped or as a command which pipes output to us, based on | position. (piped1.txt, piped2.txt)
FASTAFasta* is a family of sequence comparison programs. Description http://biocourse.weizmann.ac.il/course/prog/docfasta.html. Command line parameters for running fasta are at http://biocourse.weizmann.ac.il/course/prog/fasta_params.html. (fasta1.txt, fasta2.txt, fasta3.txt, fasta4.txt, fasta5.txt, fasta6.txt, fasta7.txt)
lynxgeneral purpose distributed information browser for the World Wide Web. Use "lynx -help" to display a complete list of current options. (lynx1.txt)
caller[caller EXPR] Returns the context of the current subroutine call. (caller.txt)
blessThis function tells the element referenced by REF that it is now an object in the CLASSNAME package. If CLASSNAME is omitted, the current package is used. It returns the reference for convenience.
figuresA step by step objects building (object01.E.txt, object02.E.txt, object03.E.txt)
animalsA step by step objects building (animals01.txt, animals02.txt, animals03.txt, animals04.txt, animals05.txt, animals06.txt, animals07.txt, animals08.txt, animals09.txt, animals10.txt, animals11.txt)
sequencebasic sample module for sequence management (moduleSample.tar)
Bioperl[module] Bioperl is a collection of perl modules that facilitate the development of perl scripts for bioinformatics applications. http://bip.weizmann.ac.il/adp/bioperl/bioSeq/

updated Sun Jun 16 16:26:40 2013, jaime.prilusky@weizmann.ac.il