Created
February 16, 2012 10:16
-
-
Save motemen/1843819 to your computer and use it in GitHub Desktop.
Launch and write to GIT_PAGER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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