in reply to How to get the width of a console window?
use strict; use Win32::Console; my $CONSOLE = Win32::Console->new(); my ($width, $height) = $CONSOLE->Size(); # $CONSOLE->Size(80, 25); # force a console size print "Console size is $width x $height\n";
Note that if the user resizes the window after the call to new(), the Size() method will not return the new size. If your application needs to handle resizing, it should create the Win32::Console object each time it needs to read the size.
|
|---|