Sorry, I can't answer that without fuller definitions of "legitimate" and "cannot be better expressed" - which does my previous example fall foul of?
Any pattern that repeats a "non-simple" expression will consume C-stack space on each repetition. At least 3 of the 4 bugs linked to the metabug #24274 arose from people solving real world tasks, and there are more in the bugs database that should also be linked to the metabug - more recent ones often involve searching for particular structures in a genome.
Here's another common fragment that invokes the problem:
though it consumes stack at only half the rate of the /(ab*)*/ variety.$_ = sprintf q{"%s"}, "a" x 32768; /"((?:\\.|[^"])+)"/;
Hugo
In reply to Re^3: What perl operations will consume C stack space?
by hv
in thread What perl operations will consume C stack space?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |