next unless s->{ID} =~ /\d\d+/;
The "s" there is a substitution and your expression as written is unterminated (there are no matching "-"s to indicate the end). If you think perl should tell you that you are missing a $ rather than a - then you are free to suggest a method for determining that, of course.
Me? I'd avoid using variables with the same names as built-in functions where possible. Saves loads of bother.
Addendum: while attempting to reproduce your error, the syntax highlighting in my editor (vim) made it very obvious indeed where the problem lay. It's not for everyone and not necessarily all the time, but syntax highlighting can be a real bonus on occasions such as this.