# Useage example: my $error = run_code('/file1.pl'); print "Run code failed, err msg:\n$error" if $error; sub run_code { my $path = shift; open(CODE, $path) || return "Oops: $path $!\n"; local $/; my $code = ; eval $code; return $@; }