## 6.2. Postfix SelectorsThe only exception to the previous guideline comes about because of another of the principles enumerated at the start of this chapter: "make it very easy to detect variations in the flow of control". Such variations come about when a
Hence it's better to place the If an sub find_anomolous_sample_in { my ($samples_ref) = @_; MEASUREMENT: for my $measurement (@{$samples_ref}) { if ($measurement < 0) { last MEASUREMENT; } my $floor = int($measurement); if ($floor == $measurement) { next MEASUREMENT; } my $allowed_inaccuracy = scale($EPSILON, $floor); if ($measurement-$floor > $allowed_inaccuracy) { return $measurement; } } return; } Be "up front" about it: ```
sub find_anomolous_sample_in {
my ($samples_ref) = @_;
MEASUREMENT:
for my $measurement (@{$samples_ref}) {
last MEASUREMENT if $measurement < 0;
my $floor = int($measurement);
next MEASUREMENT if $floor == $measurement;
my $allowed_inaccuracy = scale($EPSILON, $floor);
return $measurement
if $measurement-$floor > $allowed_inaccuracy;
}
return;
}
``` |