在这个答案,我看到了语法 <=>
;这是什么意思?这似乎是某种基于上下文的比较,但这就是我所能收集到的全部。部分上下文:
sub rev_by_date { $b->[9] <=> $a->[9] }
my @sorted_files = sort rev_by_date @files;
In this answer, I saw the syntax <=>
; what does this mean? It seems to be some sort of comparison based on the context, but that's all I can gather. Partial context:
sub rev_by_date { $b->[9] <=> $a->[9] }
my @sorted_files = sort rev_by_date @files;
发布评论
评论(1)
来自 Perldoc:
From Perldoc: