in reply to How would you shorten this regexp conditional?

This isn't golfing.   But seriously, I see no reason for the intermediates (or the logic in their names).
my $color = $file =~ /^[^-]*princepawn.*?-/ ? 'w' : 'b';
(Depending on the range of possible locations of "princepawn" in the input, the regex could be simpler.)

But since others with far deeper understanding have not suggested it, I must be missing something.

  p