You would have to grab the info via java script. If you are doing the perl CGI as a result of form submission you should do the form submit inside of JS. Allow JS to get the screen size then append that on the URL to pass as variables to the CGI.