NAME
Koha::QA::PerlSyntax - Centralized Perl syntax checking
SYNOPSIS
use Koha::QA::PerlSyntax;
# With a file
my $checker = Koha::QA::PerlSyntax->new({file => $file_path});
# Or with content directly
my $checker = Koha::QA::PerlSyntax->new({content => $file_content});
my $is_valid = $checker->check;
my @errors = $checker->errors;
DESCRIPTION
This module provides centralized Perl syntax checking using perl -cw.
METHODS
new
my $checker = Koha::QA::PerlSyntax->new({file => $file_path});
Creates a new Perl syntax checker instance.
check
my $is_valid = $checker->check;
Checks a Perl file for syntax errors and warnings using perl -cw.
errors
my @errors = $checker->errors;
Returns array of error hashrefs, each with: - error: Type of error ('perl_syntax_compil_error', 'perl_syntax_compil_aborted' or 'perl_syntax_warning') - message: Human-friendly error message
AUTHORS
Jonathan Druart <jonathan.druart@bugs.koha-community.org>
COPYRIGHT
Copyright 2026 Koha Development Team
LICENSE
This file is part of Koha.
Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.