in reply to experimental regex (?(?{code}) conditional (??{ 'code' }) )

You don't have any captures before your use of $^N, so it's always undef when you use it. Change

(?><+)

to

((?><+))

By the way,

use vars qw' $LEN ';
would be better as
local our $LEN;