in reply to Re^2: Delimeter Count?
in thread Delimeter Count?

Use -1 as the third argument of split:

$rec = 'has|trailing|pipes|||'; print(scalar(split(/\|/, $rec )), "\n"); # 3 print(scalar(split(/\|/, $rec, -1)), "\n"); # 6