It is my understanding that this is precisely what recent Perl implementations do.
Then your understanding is flawed. There's a cache, but it only holds one value: the last regexp compiled for that operator instance.
>perl -Mre=debug -e"qr/$_/ for qw( foo bar bar foo )" 2>&1 | find "Com +piling" Compiling REx `foo' Compiling REx `bar' Compiling REx `foo'
In reply to Re^2: Precompiling qr/.../o question
by ikegami
in thread Precompiling qr/.../o question
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |