¿Cuál es la forma más sencilla de realizar una solicitud HTTP GET en Perl?

Tengo un código que he escrito en PHP para consumir nuestro servicio web simple, que también me gustaría proporcionar en Perl para los usuarios que prefieren ese idioma. ¿Cuál es el método más simple de hacer una solicitud HTTP para hacer eso? En PHP puedo hacerlo en una sola línea confile_get_contents().

Aquí está el código completo que quiero portar a Perl:

/**
 * Makes a remote call to the our API, and returns the response
 * @param cmd {string} - command string ID
 * @param argsArray {array} - associative array of argument names and argument values
 * @return {array} - array of responses
 */
function callAPI( $cmd, $argsArray=array() )
{
   $apikey="MY_API_KEY";
   $secret="MY_SECRET";
   $apiurl="https://foobar.com/api";

   // timestamp this API was submitted (for security reasons)
   $epoch_time=time();

   //--- assemble argument array into string
   $query = "cmd=" .$cmd;
   foreach ($argsArray as $argName => $argValue) {
       $query .= "&" . $argName . "=" . urlencode($argValue);
   }
   $query .= "&key=". $apikey . "&time=" . $epoch_time;

   //--- make md5 hash of the query + secret string
   $md5 = md5($query . $secret);
   $url = $apiurl . "?" . $query . "&md5=" . $md5;

   //--- make simple HTTP GET request, put the server response into $response
   $response = file_get_contents($url);

   //--- convert "|" (pipe) delimited string to array
   $responseArray = explode("|", $response);
   return $responseArray;
}

Respuestas a la pregunta(8)

Su respuesta a la pregunta