Question: what is z in perl?
Answer: \z only matches the very end of the string. \Z also matches the very end of the string, but if the string ends with a newline, then \Z also matches immediately before the newline.