use strict; print "Enter your monitor's resolution?\n"; chomp ($_ = <>); $_ = /^\s*(\d+)\s*x\s*(\d+)\s*/i or die; print "The resolution is $1 x $2\n"; #### #### screen.width screen.height screen.availWidth screen.availHeight document.body.clientWidth document.body.clientHeight