my ($col, $row); if (open my $tty, '<', '/dev/tty') { ($col, $row) = Term::Size::chars (defined $tty ? $tty: *STDIN{IO}); close $tty; }