"Software error: [Tue Nov 9 18:20:21 2010] reCAPTCHA.pm: [Tue Nov 9 18:20:21 2010] reCAPTCHA.pm: [Tue Nov 9 18:20:21 2010] Tiny.pm: syntax error at HTML/Tiny.pm line 631, near "return qq{$attr="" [Tue Nov 9 18:20:21 2010] reCAPTCHA.pm: [Tue Nov 9 18:20:21 2010] reCAPTCHA.pm: [Tue Nov 9 18:20:21 2010] Tiny.pm: syntax error at HTML/Tiny.pm line 631, next token ??? [Tue Nov 9 18:20:21 2010] reCAPTCHA.pm: [Tue Nov 9 18:20:21 2010] reCAPTCHA.pm: BEGIN failed--compilation aborted at Captcha/reCAPTCHA.pm line 7. BEGIN failed--compilation aborted at captcha.cgi line 9." #### #!/usr/bin/perl -w # Simple CGI Captcha # File Name: captcha_test.cgi #open(STDERR, ">&STDOUT"); use CGI::Carp qw(fatalsToBrowser); use strict; #use warnings; use Captcha::reCAPTCHA; use CGI::Simple; # Your reCAPTCHA keys from # https://www.google.com/recaptcha/admin/create use constant PUBLIC_KEY => '-----8<--------snipped----------8<-----'; use constant PRIVATE_KEY => '-----8<--------snipped----------8<-----'; $| = 1; my $q = CGI::Simple->new; my $c = Captcha::reCAPTCHA->new; my $error = undef; print "Content-type: text/html\n\n"; print <
EOT # Check response if ( $q->param( 'recaptcha_response_field' ) ) { my $result = $c->check_answer( PRIVATE_KEY, $ENV{'REMOTE_ADDR'}, $q->param( 'recaptcha_challenge_field' ), $q->param( 'recaptcha_response_field' ) ); if ( $result->{is_valid} ) { print "Yes!"; } else { $error = $result->{error}; } } # Generate the form print $c->get_html( PUBLIC_KEY, $error ); print < EOT