<commit_before>=head1 NAME

SGN::Controller::CGI - run SGN CGI scripts

=cut

package SGN::Controller::CGI;

use Moose;
use namespace::autoclean;

BEGIN{ extends 'Catalyst::Controller::CGIBin'; }

use Carp;
use File::Basename;

my %skip = map { $_ => 1 } qw(
  another_page_that_doesnt_compile.pl
  page_with_syntax_error.pl
);

sub is_perl_cgi {
    my ($self,$path) = @_;
    return 0 if $skip{ basename($path) };
    return $path =~ /\.pl$/;
} #< all our cgis are perl

around 'wrap_cgi' => sub {
    my $orig = shift;
    my $self = shift;
    local $SIG{__DIE__} = \&Carp::confess;
    $self->$orig( @_ );
};


1;<commit_msg>force backtraces from CGIs only active in debug mode<commit_after>=head1 NAME

SGN::Controller::CGI - run SGN CGI scripts

=cut

package SGN::Controller::CGI;

use Moose;
use namespace::autoclean;

BEGIN{ extends 'Catalyst::Controller::CGIBin'; }

use Carp;
use File::Basename;

my %skip = map { $_ => 1 } qw(
  another_page_that_doesnt_compile.pl
  page_with_syntax_error.pl
);

# all our .pl cgis are perl
sub is_perl_cgi {
    my ($self,$path) = @_;
    return 0 if $skip{ basename($path) };
    return $path =~ /\.pl$/;
}

around 'wrap_cgi' => sub {
    my $orig = shift;
    my $self = shift;
    my ($c) = @_;
    local $SIG{__DIE__} = $c->debug ? \&Carp::confess : $SIG{__DIE__};
    $self->$orig( @_ );
};


1;
{'fraction_non_alphanumeric': 0.1632047477744807, 'fraction_numerical': 0.005934718100890208, 'mean_word_length': 3.6517241379310343, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1748393', 'n_tokens_mistral': 559, 'n_tokens_neox': 532, 'n_words': 130}