substr($links, 0, 1) = undef; or even substr($links, 0, 1, undef);