http://www.perlmonks.org?node_id=771891


in reply to Re^2: string error message
in thread string error message

That regex won't produce undef for one of the captures only some of the time - the match is failing, so all the variables are presumably undef.