Skip to content

Instantly share code, notes, and snippets.

@motemen
Created February 16, 2012 10:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motemen/1843819 to your computer and use it in GitHub Desktop.
Save motemen/1843819 to your computer and use it in GitHub Desktop.
Launch and write to GIT_PAGER
#!perl -l
use strict;
use warnings;
local *STDOUT = do {
if (my $pager = $ENV{GIT_PAGER} // qx(git config --get core.pager)) {
open my $pipe, '|-', $pager;
$pipe;
} else {
*STDOUT;
}
};
print ...;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment