in reply to if (empty record set)

if (@bkmark == 0) { or even if (scalar @bkmark == 0) {

length is for use on scalar values. In fact, perlfunc says this about length:
"length EXPR
Returns the length in characters of the value of EXPR. If EXPR is omitted, returns length of $_. Note that this cannot be used on an entire array or hash to find out how many elements these have. For that, use scalar @array and scalar keys %hash respectively."

Update: Two different approaches to the same problem. Heh.