in reply to Store operation in a variable

Perhaps what you need is a dispatch table.
for my $score (sort { &{ $dispatch{$condition} } } keys %scores){ ...
Then have a sub for each possible condition.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."