or download this
# read post from PayPal system and add 'cmd'
read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
$query .= '&cmd=_notify-validate';
...
$req->content_type('application/x-www-form-urlencoded');
$req->content($query);
$res = $ua->request($req);