use warnings; use strict; use Win32::Console qw(GENERIC_READ GENERIC_WRITE); use Data::Dump qw(dd); my $con_current = Win32::Console->new(GENERIC_READ | GENERIC_WRITE); $con_current or die 'new Win32::Console failed'; my ($left, $top, $right, $bottom) = $con_current->Window; print "Dimensions (left top right bottom):",qq($left, $top, $right, $bottom \n); my $rect = $con_current->ReadRect($left, $top, $right, $bottom); $rect or die 'read Win32::Console failed'; #$rect =~ s{ \0\a\0 } ''xmsg; #$rect =~ s{ [ ]+ \z } ''xmsg; #dd $rect; print qq{======\nBefore writing anything from Win32.:Console\n======\n}; $con_current->WriteRect($rect,$left, $top, $right, $bottom )or die 'write Win32::Console failed'; print "dd of \$rect: "; dd $rect; ##OUTPUT Dimensions (left top right bottom):0, 0, 119, 29 ====== Before writing anything from Win32.:Console ====== dd of $rect: (" \0\37\0" x 3600)