Perl Captcha

Hey Guys,

Just wondering it is possible to create a captcha, using perl for the current system date time..

For example:
Wed Apr 21, 2010, 19:23

This currently is printed with the following code:

sub print_datetime {
      @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
        ;  
      @weekDays =
        qw(Sun Mon Tue Wed Thu Fri Sat Sun);  
      (
            $second,     $minute,    $hour,
            $dayOfMonth, $month,     $yearOffset,
            $dayOfWeek,  $dayOfYear, $daylightSavings
      ) = localtime();
      $year = 1900 + $yearOffset;
      $theTime =
        "$weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year, $hour:$minute";
      return $theTime;
}

$q->h1( "Survey", '<em>', print_datetime(), '</em>' );

I found these two links:

http://search.cpan.org/~unrtst/Authen-Captcha-1.023/Captcha.pm
http://bumblebeeware.com/captcha/

I am unsure if this is possible, so instead of printing the "print_datetime" I could display that perl captcha which would refresh automatically...

Please help

LVL 1
ShivtekAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TintinCommented:
I think the easiest and quickest way to add captcha support is to use Captcha::ReCAPTCHA.

http://search.cpan.org/~andya/Captcha-reCAPTCHA-0.92/lib/Captcha/reCAPTCHA.pm

Once you've got your key, it requires very little code to implement and isn't dependent on various graphics modules on your system.

BTW, your print_datetime subroutine, could be shorted to

use POSIX 'strftime';

sub print_datetime {
   return strftime "%a %b %d, %Y, %H:%M",localtime;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ShivtekAuthor Commented:
Thank you,

You seem to be a perl genius!!

Can the captcha automatically display the date?
0
TintinCommented:
Recaptcha displays words.

See http://recaptcha.net/learnmore.html for details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.