题
是有没有东西可以获得终端化?
(例如perl5“术语:: readkey :: getterminalsize”);
解决方案
I'm not aware of a direct method, but parsing qx/resize/
should work on systems where the resize command is available.
Update: somewhat golfed parsing code:
my %h = qx/resize/.lines.grep(/\=/).map: { m/(\w+) \= (\d+) /; $/.list };
my ($y, $x) = %h<LINES COLUMNS>;
不隶属于 StackOverflow