http://www.perlmonks.org?node_id=869324


in reply to Match operator fails for elements 100 and higher

Interestingly, things start working again at 999. i.e.
m/$mystrings[998]/; # Fails m/$mystrings[999]/; # Works m/$mystrings[1000]/; # Works
Deparse shows it's indeed parsed differently, but doesn't show why:
> perl -MO=Deparse x Global symbol "$mystrings" requires explicit package name at x line 10 +. x had compilation errors. use strict 'refs'; my(@mystrings) = 'string' x 200; $mystrings[99]; "$mystrings[100]"; /$mystrings[999]/; /${'mystrings'}[998]/;

Update: These values also work: 111, 222, 333, 444, 555, 666, 777, 888. And apparently above 1000 it's not simple either. The first working ones after 1000 are: 1110, 1111, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1131, 1141, 1151, 1161, 1171, 1181, 1191, 1311, 1333, 1411

Overall, there's 393 values from 0 to 10,000 for which it works. The rest fail.