in reply to Location of Conditional test effects results

Nobody (yet) has mentioned how your code could have been written to fix the mistake, so I'll do it ;)
for my $record (@$records) { my $editor; print $lbr, "Record: $record->{'zone_record_id'}"; if ( @{$record->{services}} == 0 ) { $editor = 'plain edit'; } elsif ( $record->{services}[0]{class} =~ /Primary|Secondary/ ) { $editor = 'no editor'; } else { $editor = 'service edit'; } print $editor; }
The point being: once you establish that you've reached an empty slot at a given point in your structure, you may want to avoid going any deeper down that particular path, unless you really do want to create new structure where none existed previously.