Skip to content

Commit 2a125ef

Browse files
committed
simplify code for providing a default COLUMNS
Catalyst no longer warns about Term::Size::Any being missing if COLUMNS is set.
1 parent 778ef12 commit 2a125ef

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/MetaCPAN/Web.pm

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,7 @@ __PACKAGE__->config(
4444

4545
__PACKAGE__->log( Log::Log4perl::Catalyst->new( undef, autoflush => 1 ) );
4646

47-
# Squash warnings when not in a terminal (like when running under Docker)
48-
# Catalyst throws warnings if it can't detect the size, even if $ENV{COLUMNS}
49-
# exists. Just lie to it to shut it up.
50-
use Term::Size::Perl ();
51-
if ( !Term::Size::Perl::chars() ) {
52-
no warnings 'once', 'redefine';
53-
*Term::Size::Perl::chars = sub { $ENV{COLUMNS} || 80 };
54-
}
47+
$ENV{COLUMNS} ||= 80;
5548

5649
after prepare_action => sub {
5750
my ($self) = @_;

0 commit comments

Comments
 (0)