belg4mit is sooooo right about the security risk ... but if you mst do this, i suggest the following :
- Run the code as an unprivileged user
- chroot the unprivileged user to a specific dir
- If this is linux, check the internet for per-user CPU limitation.
$ perl -e 'do() || ! do() ;'
Undefined subroutine &main::try