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


in reply to Why this simple code doesn't work?

This isn't part of your problem, but in the interest of simplifying your regex: starting a regex with ^.* is useless. These are identical:

/^.*foo/ /foo/

Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.