Cheat Sheet

I never remember this stuff, so it is collected here to accelerate my frequent look-ups of it.

Perl 'my' and 'local'

my
Declare variable with scope and lifetime equal to containing block, ie what C calls 'auto'.
local
Import previously-declared variable into the scope containing the 'local' - ie no new variable is created. However any change to variable's value within the block will be discarded at end of block, as if the old value had been restored immediately after the end of the block.
More in this relevant PerlMonks node.

GNU Make Automatic Variables

$@
Filename of the target of the rule.
$<
Name of the first prerequisite.
$?
The names of all the prerequisites that are newer than the target.
$^
The names of all the prerequisites of the target.
$*
The stem with which an implicit rule matches.
More detail in the relevant GNU Make documentation.

mtime versus ctime

mtime
Change to file data, or creation/deletion of files in a dir.
ctime
Change to file metadata (inode).
Mnemonic: Change Data but Modify Metadata.

Bash Variables

$*
Expands to the positional parameters, starting from one. Inside double quotes, expands to a single word with the value of each parameter separated by the first character of the IFS special variable.
$@
Expands to the positional parameters, starting from one. Inside double quotes, each parameter expands to a separate word.