Perl Map cgi::param
my $app = { 'form' => { map { $_ => ($cgi->param($_))[0] } $cgi->param }, };
my $app = { 'form' => { map { $_ => ($cgi->param($_))[0] } $cgi->param }, };
sub discord { use LWP; use HTTP::Request; use JSON; my ($_a) = @_; my ($_r); my $_msg = { 'username' => 'chsm-ext', 'content' => $_a, }; my $_json = JSON->new->allow_nonref; my $_ua = LWP::UserAgent->new; my $_req = HTTP::Request->new(POST => 'https://discord.com/api/webhooks/'.$app->{'discord'}); $_req->content_type('application/json'); $_req->header("User-Agent" => "Perl Discord HookBot"); $_req->content($_json->encode($_msg)); $_r = $_ua->request($_req); return $_r; }
Options +ExecCGI AddHandler cgi-script .cgi .sh .pl .py SetEnvIfNoCase Content-Type \ "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads" SetEnv no-gzip dont-vary
my @now = localtime; $now[5] += 1900; $now[4] += 1; for my $l (0 .. (scalar(@now) - 1)) { $now[$l] = sprintf("%02d",$now[$l]); }
my @sorted = map substr($_, 4) => sort map pack('C4' => /(\d+)\.(\d+)\.(\d+)\.(\d+)/) . $_ => keys $output;
use PadWalker qw(peek_my); use Data::Dumper; my $s = "a string"; { my @a = qw(an array); print Dumper( peek_my(0) ); } my %h = qw(a hash); print Dumper( peek_my(0) ); sub debugger { use Data::Dumper; $Data::Dumper::Indent = 1; $Data::Dumper::Purity = 1; $Data::Dumper::Terse = 0; $Data::Dumper::Deparse = 1; my ($_a) = @_; open(my $_debug,'>','./logs/'.$_a->{'facility'}.'-debug.log'); print $_debug Dumper($_a->{'data'})."\n"; close($_debug); }
my @d = localtime; $d[5] += 1900; $d[4] += 1; for my $l (0 .. (scalar(@d) - 1)) { $d[$l] = sprintf("%02d",$d[$l]); }
for my $s (0 .. (scalar(@source_list) - 1)) { print " - Loading: $source_list[$s]\n"; push(@sources,do "$srpz_home/sources/$source_list[$s]\.pl"); }
Text::APL - non-blocking and streaming capable template engine