Please read the documentation. The undef is very necessary here and refers only to the value for the second argument being passed to the method do. Explaining exactly what that argument is for is difficult, at best. Otherwise you are very very close to understanding how this works.