I tried it this way, but it doesn\'t work - the returned values from getmaxyx remain always the same.
getmaxyx
#!/usr/bin/env perl use warnings; use 5.012; u
Knowing almost nothing about Curses, at a first guess I'd say your problem is that you broke $SIG{WINCH}, because libcurses is going to want to use that to detect when the window may have changed size.
Curses
$SIG{WINCH}
libcurses