http://www.perlmonks.org?node_id=181570

Seumas has asked for the wisdom of the Perl Monks concerning the following question:

I know that you can get the size of a visitor's screen using Javascript with screen.width, but I don't know enough Javascript to know if there is a way to pass this value on to Perl some how? Or better, a way to get this value with Perl itself?

A google search didn't turn up anything Perl related and a search here only returned a way to use Term::Readkey to get the screen size of a local terminal user.

My aim isn't (at this time at least) to redirect a user based on their screen size, but rather to log this data. I somehow need to get their screen size and INSERT it into their account record in Postgresql via Perl. The only solution I've found is to use Javascript to detect their screen size, redirect them to a page based on this size, then have that page populated with pre-filled FORM data that is submitted to Perl and INSERTed. There must be a more elegant way though. Either to detect the screen size with Perl or to elegantly pass the value of the Javascript screen.width to a hidden form <input> that can be submitted to Perl.

Having little experience (or interest) in Javascript, I'm not sure how I might do this.