in reply to Regular Expression memory
What happens if the match fails? You need an if in there.
if (m|(<Id>)(.*?)(</Id>)|) { print "1 - '$1'\n2 - '$2'\n3 - '$3'\n"; } else { print "Hmm, no match. Is this what happened?\n"; } [download]