0

This question already has an answer here:

In an UNIX environment running AIX where I'm a not privileged user (without sudo) if I need to download a file from HTTPS server and there is no wget or curl... How I do it?

Is there any replacement for wget/curl?

marked as duplicate by Jeff Schaller, Kusalananda, Stephen Harris, mosvy, RalfFriedl Dec 4 '18 at 6:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • the only change would be s/POST/GET in the corresponding answer. – Jeff Schaller Dec 3 '18 at 18:03
  • thank you for this link. The given solution didn't worked well (script hanged/freezed). But seeking on how to download with perl has opened my mind and I found a solution that I posted below. – adamitj Dec 3 '18 at 18:28
1

Well, the given "possibly duplicate" solution didn't worked well as the file has more than 3.9 Gigabytes. But searching on how download files with perl, I found an useful script from here that worked fine then I edited to receive 2 arguments:

1) the download link

2) the local filename

## Using Mechanize
use WWW::Mechanize;

my $url = $ARGV[0];
my $local_file_name = $ARGV[1];

my $mech = WWW::Mechanize->new;

$mech->get( $url, ":content_file" => $local_file_name );

Not the answer you're looking for? Browse other questions tagged or ask your own question.