Debugging Options

#!/usr/bin/perl -w combined with the webserver error log, ie. /var/log/httpd/error_log.

use strict; combined with the webserver error log.

Set the MS_ERRORFILE environment variable at the top of your script, ie.
$ENV{MS_ERRORFILE} = "../html/tmp/mapserver.log";

Look at the "Page Source" in the browser.

Insert debugging lines in the code, ie.
print "X = $pickx\nY = $picky\n";
$pnt->{x} = $pickx;
$pnt->{y} = $picky;

Even though the script may bomb trying to use the value of $pickx by veiwing the browser source you can still check the value of $pickx.