in reply to Regex match: Ignoring first occurences

#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1138025 use strict; use warnings; $_ = <<END; <xml> <info> <file>file:/path/to/some/file.mxf</file> </info> <info> <file>file:/path/to/some/file.xml</file> </info> </xml> END print m{.*<file>file:(.*?\.xml)</file>}s ? $1 : "xml not found";