| print scalar( localtime( [unixtime] )) | print a human readable date/time from a unix time stamp |
| use lib '/path/to/look/in'; | includes a library that is not in the perl include directories (@INC) |
| my $value ||= "Default"; | set a variable if not set |
| perl -V | list directories in perl include array (@INC) |
| $value =~ s/^\s+//; | remove leading whitespace |
| $value =~ s/\s+$//; | remove trailing whitespace |
| perl -e 'print scalar localtime( [unixtime] ), "\n"' | command line translation of unixtime to human readable |
| eval { $@=0; require '/file/to/be/tested.pl';}; if( $@ ){ #handle error } | debugging scheme |
| perldoc [module name] | useful perl documentation |
| CPAN | archive for perl modules |
| perl -pi -e "s/old/new/g" filename | command line string replacement in filenemt |
| /^[a-zA-Z0-9_.\-]+@[a-zA-Z0-9_.\-]+$/ | Regular expression to test for valid email address |
| my $var = 42; $result = "before${var}after"; | How to incorporate a variable in a string. |