[pm-h] LWP::Simple getstore

Mike Flannigan mikeflan at att.net
Sun Feb 2 16:41:35 PST 2020


I have a nasty little problem here I am debugging.
The simple script below works great on Win10.  On
Linux Mint it gives "Error: 501" immediately.

I can paste the URL into my browser on Linux Mint and
download the file with no problems.

Very strange.  I guess I will try LWP::UserAgent
as an alternative.


#!/usr/bin/perl

use strict;
use warnings;
use LWP::Simple;

my $status = getstore 
('https://prd-tnm.s3.amazonaws.com/StagedProducts/Maps/HistoricalTopo/PDF/WY/24000/WY_Arapahoe_338289_1959_24000_geo.pdf', 
'map.pdf');

if(is_success($status)){
    print "Success\n";
}
else{
    print "Error: $status\n";
}


__END__


It must have something to do with the website itself since
the script below works just fine on Linux Mint.

Does the script above work for any of you on a Debian system?

Well, it just keeps getting more interesting.  If I change
'https' to 'http' in the URL it works fine!

Any explanations?  I'm still on Duck Duck Go to figure this out.



#!/usr/bin/perl -w
#
#
# This program writes the results of the webpage listed in line 16
# to test.txt in '/home/mike/Documents/copy'.
#
#

#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;

chdir '/home/mike/Documents/copy';

getstore('http://www.ipaddresslocation.org/my-ip-address.php', 
'test.txt') or die 'Unable to get page';



print "\nAll done.\n";


__END__


More information about the Houston mailing list