aboutsummaryrefslogtreecommitdiff
path: root/gmi.pl
diff options
context:
space:
mode:
Diffstat (limited to 'gmi.pl')
-rwxr-xr-xgmi.pl24
1 files changed, 15 insertions, 9 deletions
diff --git a/gmi.pl b/gmi.pl
index 3eb79be..baac889 100755
--- a/gmi.pl
+++ b/gmi.pl
@@ -686,16 +686,22 @@ sub display {
$wrapper->columns($wc);
}
if ($use_pager) {
- IO::Pager::open(my $FH) or warn($!);
- for (@doc) {
- _pre_block($_);
- if ($pre_block) {
- print $FH $_;
- }
- else {
- print $FH $wrapper->wrap($_);
+ ### opening IO Pager
+ eval {
+ # catch it or big files ( >1000 lines ) will load but the script itself dies for some reason
+ local $SIG{PIPE} = sub { die };
+ IO::Pager::open(my $FH) or warn($!);
+ for (@doc) {
+ _pre_block($_);
+ if ($pre_block) {
+ print $FH $_;
+ }
+ else {
+ print $FH $wrapper->wrap($_);
+ }
}
- }
+ close $FH;
+ };
}
else {
for (@doc) {