Cataly...Captcha(3pm)
β¨ Cataly...Captcha β Catalyst::Plugin::Captcha π
okay bestie, so this page is literally the manual for Catalyst::Plugin::Captcha, and it lives in section 3pm of the Perl docs (user contributed Perl documentation, iykyk). grab a strawberry π and let's get into it.
πΈ NAME πΈ
Catalyst::Plugin::Captcha β the plugin that creates and validates Captcha for Catalyst. yes ma'am, that's the whole job and it does it fabulously π
β¨ SYNOPSIS β¨
here's the vibe, copy-paste ready:
use Catalyst qw/Captcha/;
MyApp->config->{ 'Plugin::Captcha' } = {
session_name => 'captcha_string',
new => {
width => 80,
height => 30,
lines => 7,
gd_font => 'giant',
},
create => [qw/normal rect/],
particle => [100],
out => {force => 'jpeg'}
};
sub captcha : Local {
my ($self, $c) = @_;
$c->create_captcha();
}
sub do_post : Local {
my ($self, $c) = @_;
if ($c->validate_captcha($c->req->param('validate')){
..
} else {
..
}
}
#validate with CP::FormValidator::Simple
sub do_post : Local {
my ($self, $c) = @_;
$c->form(
validate => [['EQUAL_TO',$c->captcha_string]]
)
}
like, look at that config block. it's giving organized. it's giving I know what I'm doing. π
π DESCRIPTION π
This plugin create, validate Captcha. that's the whole errand, no notes.
β οΈ heads up bestie: this plugin usesGD::SecurityImageand it requires a session plugin, likeCatalyst::Plugin::Session. no session, no captcha, no slay. periodt.
π¦ METHODS π¦
π create_captcha
Create Captcha image and output it. that's it. that's the method. make the image, spit it out. π
π validate_captcha
$c->validate_captcha($key);
validate key. you hand it the key, it tells you if it's real or if someone's out here lying. π
π captcha_string
Return a string for validation which is stroed in session. (yes, "stroed" β we keep the original spelling, no cap, it's iconic in its own way π)
π clear_captcha_string
Clear a string which is stroed in session. bye bye string, you did great π«Ά
π CONFIGURATION π
π session_name
The keyword for storing captcha string.
π new
π create
π particle
π out
These parameters are passed to each GD::Security's method. Please see GD::SecurityImage for details. (so like, if you wanna know what new, create, particle and out actually do β the details live over in that other page. this page is just the messenger π§)
β SEE ALSO β
GD::SecurityImage, Catalyst β go read those too, bestie, they're the supporting cast and they ate.
π AUTHOR π
Masahiro Nagano <kazeburo@nomadscafe.jp> β legend behavior, fr fr.
π COPYRIGHT AND LICENSE π
Copyright (C) 2006 by Masahiro Nagano
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
and that's the whole page!! π
β¨ this one was rendered by perl v5.26.1, dated 2018-03-30, under the manual name Cataly...Captcha(3pm) β mwah, take care of her, she's vintage ππ¦π
π¦ where this page comes from
- debian bookworm: libcatalyst-plugin-captcha-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatalyst-plugin-captcha-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcatalyst-plugin-captcha-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatalyst-plugin-captcha-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms