invoke class method
How to invoke a class method.
PHP
PHP Manual
General Style and Syntax Codeigniter
Coding Standards Pear
PHP Style Guide Apache
The PHP interpreter is packaged in 3 different ways: (1) as a standalone executable which can be executed as a CGI script, (2) as a dynamically linked library which adheres to the SAPI of a webserver such as Apache or IIS, and (3) as a standalone executable which can be used to run PHP scripts from the command line. The latter executable is called PHP C
From the perspective of a PHP programmer, there no important differences between PHP CGI and PHP SAPI. The programmer should be aware of the following differences between PHP CGI/SAPI and PHP CLI:
- PHP CGI/SAPI writes HTTP headers to standard out before any output specified by the program. PHP CLI does not.
- PHP CLI sets the constants STDIN, STDOUT, and STDERR. PHP CGI/SAPI do not.
- PHP CLI has no timeout. PHP CGI/SAPI will typically timeout a script after 30 seconds.
- PHP CGI/SAPI add HTML markup to error messages. PHP CLI does not.
- PHP CLI does not buffer output, so calling flush is never necessary. PHP CGI/SAPI buffer output.
Perl
perldoc
core modules
man perlstyle
The first character of a perl variable ($, @, %) determines the type of value that can be stored in the variable (scalar, array, hash). Using an array variable (@foo) in a scalar context yields the size of the array, and assigning scalar to an array will set the array to contain a single element. $foo[0] accesses the first element of the array @foo, and $bar{‘hello’} accesses the value stored under ‘hello’ in the hash %bar. $#foo is the index of the last element in the array @foo.
Scalars can store a string, integer, or float. If an operator is invoked on a scalar which contains an incorrect data type, perl will always perform an implicit conversion to the correct data type: non-numeric strings evaluate to zero.
Scalars can also contain a reference to a variable, which can be created with a backslash: $baz = \@foo; The original value can be dereferenced with the correct prefix: @$baz. References are how perl creates complex data structures, such as arrays of hashes and arrays of arrays. If $baz contains a reference to an array, then $baz->[0] is the first element of the array. if $baz contains a reference to a hash, $baz->{‘hello’} is the value indexed by ‘hello’.
The literals for arrays and hashes are parens with comma separated elements. Hash literals must contain an even number of elements, and ‘=>’ can be used in placed of a comma ‘,’ between a key and its value. Square brackets, e.g. [ 1, 2, 3 ], create an array and return a reference to it, and curly brackets, e.g. { ‘hello’ => 5, ‘bye’ => 3 }, create a hash and return a reference to it.
By default perl variables are global. They can be made local to the containing block with the my or the local keyword. my gives lexical scope, and local gives dynamic scope. Also by default, the perl interpreter creates a variable whenever it encounters a new variable name in the code. The ‘use strict;’ pragma requires that all variables be declared with my, local, or our. The last is used to declare global variables.
perl functions do not declare their arguments. Any arguments passed to the function are available in the @_ array, and the shift command will operate on this array if no argument is specified. An array passed as an argument is expanded: if the array contains 10 elements, the callee will have 10 arguments in its @_ array. A reference (passing \@foo instead of @foo) can be used to prevent this.
Some of perl’s special variables:
- $$: pid of the perl process
- $0: name of the file containing the perl script (may be a full pathname)
- $@: error message from last eval or require command
- $&, $`, $’: what last regex matched, part of the string before and after the match
- $1..$9: what subpatterns in last regex matched
Python
2.7: Language, Standard Library
Why Python3 Summary of Backwardly Non-compatible Changes in Python 3
3.2: Language, Standard Library
PEP 8: Style Guide for Python Code van Rossum
Python uses leading whitespace to indicate block structure. It is not recommended to mix tabs and spaces in leading whitespace, but when this is done, a tab is equal to 8 spaces. The command line options ‘-t’ and ‘-tt’ will warn and raise an error respectively when tabs are used inconsistently for indentation.
Regular expressions and functions for interacting with the operating system are not available by default and must be imported to be used, i.e.
Relevant pages:
- 2004 Hyperlite Wakeboards
- Perltk Mac Os X
- Cgi Forms Perl
Very popular Perl 4/5 module for simple CGI tasks, such as reading form input.
- Geocaching Paperless
CacheSense (formerly CacheBerry) paperless geocaching - Powered by Geocaching Live
- Perl Beginners Guide




