use Win32::Console qw(STD_OUTPUT_HANDLE GENERIC_READ GENERIC_WRITE); use Data::Dump qw(dd); ;; my $con_current = Win32::Console->new(STD_OUTPUT_HANDLE) ; $con_current or die 'new Win32::Console failed'; ;; my ($left, $top, $right, $bottom) = $con_current->Window; printf qq{Dimensions left %d top %d right %d bottom %d \n}, $left, $top, $right, $bottom; ;; my $rect = $con_current->ReadRect($left, $top, $right, $bottom); $rect or die 'read Win32::Console failed'; ;; $_ += 2 for $top, $bottom, $left, $right; $con_current->WriteRect($rect,$left, $top, $right, $bottom )or die 'write Win32::Console failed';