in reply to Timeout alarm for regex

From doc:perlipc for v5.8.5:

As Perl interpreter only looks at the signal flags when it about to execute a new opcode if a signal arrives during a long running opcode (e.g. a regular expression operation on a very large string)the signal will not be seen until operation completes.

Also, think about what you are asking the OS to do: first, you tell the OS to interupt you in x seconds then, you hog all the CPU cycles so nothing else gets done. On a preemptive multitasker this will work but the performance can still suffer.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}