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


in reply to Re: Re: Grabbing file prefixes with Reg Exp
in thread Grabbing file prefixes with Reg Exp

\z only matches at the end of the string, but $ can match before a newline at the end. Unless you're using multiline mode, \A and ^ are the same.