A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Select sub-section of putty buffer only

Are you sick and tired of waiting for your terminal to scroll down when dragging to select a large portion of the scrollback buffer in putty?

The putty developers already thought of that!


  1. Go to Putty Configuration window
  2. Choose "Selection" from category on the left of the window.
  3. Under 'Control use of mouse', choose 'Compromise (Middle extends, Right pastes)' if not already chosen.

(source)

Use Data::Compare to compare data outside a test

Need to compare data outside of a test, without generating "ok" / "not ok" TAP output? Use Data::Compare.

Perltidy docs / example config

Docs

Reference for all the possible perltidy options
More detailed explanation of some the options

Team perltidy options

ruleexplanationnotes
-i=4
4 column indentA lot of the legacy code has 2 column indent.
-pt=2
"horizontal tightness" 2 - no space for parenthesis tokens
 if ( ( my $len_tab = length( $tabstr ) ) > 0 ) {  # -pt=0
 if ( ( my $len_tab = length($tabstr) ) > 0 ) {    # -pt=1 (default)
 if ((my $len_tab = length($tabstr)) > 0) {        # -pt=2
(docs)
-wls='=>'
ensure there's always space to the left of =>
-wrs='=>'
...and always to the right of =>
-vtc=0
always break before a closing token (default)i.e. non-block curly braces, parentheses, and square brackets docs
-l=79
Lines should be no more than 79 characters wide
-nolc
no "outdenting" for long comments - indent them properlyBy default, full-line (block) comments longer than the value maximum-line-length will have their indentation removed ("outdented"). This rule prevents that. docs
-nolq
no "outdenting" for long quotes/stringsdocs
-sot
stack opening tokens - same as -sop -sohb -sosbPut opening parentheses, braces, etc. on the same line docs
-sct
stack closing tokensPut closing parentheses, braces, etc. on the same line docs

Options that were removed

ruleexplanationnotes
-lp
line up parenthesesSee docs
-vt=2
define opening vertical tightnessPut opening parentheses, braces, etc. on the same line. Related to -lp docs
-vt=0
always break a line after opening tokendocs
-st -se
use as a filterInstructions to the parser docs
-nsfs
'for' loop semicolon spaces
The default is to place a space before a semicolon in a for statement, like this:
    for ( @a = @$ap, $u = shift @a ; @a ; $u = $v ) {  # -sfs (default)
If you prefer no such space, like this:
    for ( @a = @$ap, $u = shift @a; @a; $u = $v ) {    # -nsfs
then use nsfs.
-nbbc
No blanks before commentsBy default, a blank line will be introduced before a full-line comment. This rule prevents that.