line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SQL::Statement::Function::ByName::YEAR; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1672
|
use 5.010001; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
141
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
8
|
|
|
|
|
|
|
our $DATE = '2022-12-12'; # DATE |
9
|
|
|
|
|
|
|
our $DIST = 'SQL-Statement-Functions-Date'; # DIST |
10
|
|
|
|
|
|
|
our $VERSION = '0.050'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub SQL_FUNCTION_YEAR { |
13
|
4
|
|
|
4
|
0
|
21
|
my $param = $_[2]; |
14
|
|
|
|
|
|
|
|
15
|
4
|
100
|
|
|
|
25
|
$param =~ /^(\d{4})-/ or return undef; ## no critic: TestingAndDebugging::ProhibitExplicitReturnUndef |
16
|
3
|
|
|
|
|
16
|
$1; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
# ABSTRACT: Return the year part from a date/datetime expression |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
__END__ |