use 5.014000;
use strict;
use warnings;
+use re '/s';
our $VERSION = '5999.000_004';
my ($self) = @_;
my ($file) = (ref $self) =~ s,::,/,gr;
my $usage;
- open my $fh, '>', \$usage;
+ open my $fh, '>', \$usage; ## no critic (RequireCheckedOpen)
pod2usage(-input => $INC{"$file.pm"}, -output => $fh, -exitval => 'NOEXIT', -verbose => 99, -sections => [qw/SYNOPSIS DESCRIPTION/]);
- close $fh;
+ close $fh; ## no critic (RequireCheckedClose)
$usage =~ s/Usage:/Usage examples:/;
1 while chomp $usage;
$usage
my $name = prompt 'Contest name';
my $owner = prompt 'Owner';
- my $start = str2time prompt 'Start time' or die 'Cannot parse time';
- my $stop = str2time prompt 'Stop time' or die 'Cannot parse time';
+ my $start = str2time prompt 'Start time' or die "Cannot parse time\n";
+ my $stop = str2time prompt 'Stop time' or die "Cannot parse time\n";
db->insert(contests => {id => $id, name => $name, owner => $owner, start => $start, stop => $stop});
}
use File::Slurp qw/read_file/;
sub opt_spec {
- ['file!', 'Use the contents of a file as value'],
+ ['file!', 'Use the contents of a file as value']
}
sub usage_desc { "%c [-cjpu] set id column value [column value ...]\n%c [-cjpu] set --file id column filename [column filename ...]" }
my (%columns) = @_;
$columns{$_} = strftime '%c', localtime $columns{$_} for qw/start stop/;
- print <<END
+ print <<"END"
Name: $columns{name}
Owner: $columns{owner}
Start: $columns{start}
$columns{date} = strftime '%c', localtime $columns{date};
no warnings 'uninitialized';
- print <<END
+ print <<"END"
Problem: $columns{problem}
Contest: $columns{contest}
Owner: $columns{owner}
my (%columns) = @_;
no warnings 'uninitialized';
- print <<END
+ print <<"END"
Name: $columns{name}
Author: $columns{author}
Statement written by: $columns{writer}
$columns{since} = strftime '%c', localtime $columns{since};
no warnings 'uninitialized';
- print <<END
+ print <<"END"
Email: $columns{name} <$columns{email}>
Phone: $columns{phone}
Since: $columns{since}
use parent qw/Exporter/;
our $VERSION = '5999.000_013';
-our @EXPORT = qw/dbinit purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job take_job finish_job open_problem/; ## no critic (ProhibitAutomaticExportation)
+our @EXPORT = qw/dbinit purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job take_job finish_job open_problem/;
our @EXPORT_OK = @EXPORT;
use JSON::MaybeXS qw/decode_json/;
sub open_problem {
my ($contest, $problem, $owner, $time) = @_;
my $ct = contest_entry($contest);
- return unless $ct->{id} && $time >= $ct->{start} && $time < $ct->{stop};
- eval { db->insert(opens => {
+ return unless $ct->{id} && $time >= $ct->{start} && $time < $ct->{stop}; ## no critic (ProhibitNegativeExpressionsInUnlessAndUntilConditions)
+ eval { db->insert(opens => { ## no critic (RequireCheckingReturnValueOfEval)
contest => $contest,
problem => $problem,
owner => $owner,
[-Documentation::PodSpelling]
[-Documentation::RequirePodLinksIncludeText]
[-InputOutput::RequireBracedFileHandleWithPrint]
+[-InputOutput::RequireCheckedSyscalls]
[-Modules::ProhibitAutomaticExportation]
-[-Modules::RequireExplicitPackage]
[-References::ProhibitDoubleSigils]
[-RegularExpressions::ProhibitEnumeratedClasses]
[-RegularExpressions::ProhibitUnusualDelimiters]
+[-RegularExpressions::RequireBracesForMultiline]
[-RegularExpressions::RequireLineBoundaryMatching]
[-Subroutines::RequireFinalReturn]
[-ValuesAndExpressions::ProhibitConstantPragma]
[Subroutines::RequireArgUnpacking]
short_subroutine_statements = 5
allow_subscripts = 1
+
+[TestingAndDebugging::ProhibitNoWarnings]
+allow_with_category_restriction = 1