in reply to to get the pixels positions

Sorry, I didn't understand the question

Are you trying to adjust the size/position of a window (shell?) open from a Perl script?

Can we see some code?