Run a passed perl code and return the result