in reply to Pattern matching of the type?
You probably need to put the eol meta character at the end of your regex, something like this:
m/ \d{5} # exactly five digits $ # end of line /x; # allow comments and whitespace [download]
-- Hofmator