3 ms·
Might be unrelated, but Perl does have a hard limit on recursion within the same function; after 100 recursions it'll die with an error and you have to unroll y
by throwaway984393 5y ago
Might be unrelated, but Perl does have a hard limit on recursion within the same function; after 100 recursions it'll die with an error and you have to unroll your loops.
- bmn__ 5y agoFalse. $ perl -Mwarnings -E'sub f { $c++; say $c if 0 == $c % 1_000_000; f() } f' Deep recursion on subroutine "main::f" at -e line 1. 1000000 2000000 3000000 4000000 5000000 6000000 7000000 8000000 9000000 10000000 11000000 12000000 13000000 14000000 15000000 16000000 17000000 18000000 19000000 20000000 Terminated You get a warning after 100 calls which almost always indicates a bug. In case it's a genuine deep recursion, the warning can be easily suppressed with `no warnings "recursion"`. On my computer, the program continues to run for about 10 seconds, consuming 9 GB virt./res. after which it is killed off by `earlyoom`.
- throwaway984393 5y agoIt might have behaved slightly differently 20 years ago when I ran into it :) or maybe I misremember!