our $response = `curl -sILk wordpress.org/latest | grep Content-Disposition`; #### Content-Disposition: attachment; filename=wordpress-4.7.2.tar.gz #### sub get_latest_wordpress_version { our $url = "https://wordpress.org/latest"; our $response = `curl -sILk wordpress.org/latest | grep Content-Disposition`; our ($wp_latest_version) = $response =~ /(\d+.\d+(.\d+)?)/; return $wp_latest_version; }