Combine the two conditions
    if (not @lines and not $bag{ignore_empty}) { ... }