in reply to use strict and use Getopts

opt_w and opt_h must be package variables for getopts() to work, so declare them with 'use vars' or 'our', not 'my'. Or alternatively, use a hash (which may be declared with my) and pass a reference to it to getopts().