Cheat Sheet
Unix
Log command output
( [command] 2>&1 | tee the.log && exit $PIPESTATUS )
Perl
Start
The top should always look like this:
#!/usr/bin/perl
use warnings;
use string;
use diagnostics; #Only use if the warning you get is not good enough (or *)
* - At the command line type:
$ perl -Mdiagnostics ./my_program
Data Types
- $ - Scalar
- @ - Array
- % - Hashes
- $myValue - A single scalar value
A number, word, reference
- $myValues[10] - A single scalar value inside the 11th element
of the array @myValues
- $myValues{'aKey'} - A single scalar value inside the hash %myValues
Stored in element with key 'aKey'
- $#myValues - The last index of array @myValues