I'm canonicalizing URLs using Perl (v. 5.12) and I've noticed that the Perl program started crashing with the message "Identifier too long at (eval 1) line 1.". Through experiments I've found out that the URI
constructor throws error when the scheme part of the URL exceeds 248 symbols:
$ perl -e 'use URI; my $uri = URI->new("a" x 248 . "://bla");'
Identifier too long at (eval 1) line 1.
Why is this happening? How to prevent this?