Skip to content

Commit d0aab37

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 9fb7790 commit d0aab37

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
@@ -43,14 +43,7 @@ __PACKAGE__->config(
4343

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

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

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

0 commit comments

Comments
 (0)