my $jar='xxxxxx.jar'; my $url = "http://ip_address:port/artifactory/api/search/artifact?name=".$jar."&repos=xxxxx-3rdparty-libs-local,Central_Maven_repository-cache,Jcenter,Jcenter-cache,FuseSource,MavenRedHat,ApacheArchive,Central_Maven_2_repository-cache,xxxxx-3rdparty-libs-common,Central_Maven_2_repository,Central_Maven_repository,Jcenter and Gradle-Remote"; my $response; my $ff = File::Fetch->new(uri => $url); $ff->fetch( to => \$response) or die $ff->error; print Dumper $response; #### $VAR1 = '{ "results" : [ { "uri" : "http://ipaddress:port/artifactory/api/storage/Central_Maven_2_repository-cache/org/xxxxx.jar" }, { "uri" : "http://ipaddress:port/artifactory/api/storage/xxxxx-3rdparty-libs-local/org/xxxxx.jar" } ] }'; #### Can't use string ("{ "results" : [ { "uri" : "...) as a SCALAR ref while "strict refs" in use at artifactory_url.pl line 39. #### if ($response =~/"uri" : "(.*?)"/){ print($1."\n"); }else{ print("Fetch failed\n"); }