The [TOOLFK] online Perl code execution tool to be recommended in this article provides online Perl code execution functions.
Website name: ToolFk
website link: https://www.toolfk.com/Tool
link: https://www.toolfk.com/tool-online-run-perl
website link: https://www.toolfk.com/Tool
link: https://www.toolfk.com/tool-online-run-perl
Code teaching
This tool [online Perl code execution tool] depends on the Docker Perl image
STEP 1 interface
STEP2
The execution code is as follows
static function dockerRunPerl($code){
$ext = "pl";
list($base_url,$filename) = self::runWriteFile("Perl",$code,$ext);
$full_path = $base_url."/".$filename;
return self::dockerRun($base_url,' scorpil/rust:latest perl '.$filename,$ext,$full_path);
}
private static function dockerRun($base_url,$cmd,$pre,$full_path){
$random_name = $pre.mt_rand(1,999999999999);
$cmd = env("TOOL_DOCKER_PATH")." run --name {$random_name} --rm -v {$base_url}:/usr/src/{$pre} -w /usr/src/{$pre} {$cmd} 2>&1";
$res = shell_exec($cmd);
return $res;
}
留言
發佈留言