From mikeflan at att.net Sun Feb 2 16:41:35 2020 From: mikeflan at att.net (Mike Flannigan) Date: Sun, 2 Feb 2020 18:41:35 -0600 Subject: [pm-h] LWP::Simple getstore References: Message-ID: 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__ From lembark at wrkhors.com Mon Feb 3 19:27:21 2020 From: lembark at wrkhors.com (Steven Lembark) Date: Mon, 3 Feb 2020 21:27:21 -0600 Subject: [pm-h] Perl on Linux Mint In-Reply-To: References: Message-ID: <20200203212721.6cb3c9e6.lembark@wrkhors.com> Install your local system perl in /opt, as per the file system standard. Put /opt/bin at the front of people's paths (vs. /usr/local which was done away with a decade+ ago with the switch to SVr4). At that point you have a single shared installation of perl that is easily upgraded (via the symlinks in /opt/perl) and won't interfere with the system perl in /usr/bin/. You also won't have to chase down 500 different copies of perl and all of its installed lib's in every developer's home directory. Minimal system install of a local perl that doesn't step on the system version, hack to suit your needs, caveat utilitor. #!/bin/bash echo "Installing perl from: ${1:?Sorry, need a source tarball}"; base=$(basename $1 '.tar.gz' ); vers=${base#perl-}; args="-ds -e -Dprefix=/opt/perl/$vers -Doptimize='-O2 -pipe -march=native'"; cd /var/tmp; gzip -dc < $1 | tar xvf -; cd $base; ./Configure $args; make -wk all test install; # /opt/perl/bin is the current install. # downgrade or upgrade via "rm *; ln -fs /* ." cd /opt/perl; rm *; ln -fs 5.30/* .; # this only has to be done once or if anything new shows up in # the current install. [ -d /opt/bin/ ] || mkdir /opt/bin; cd /opt/bin/; ln -fs ../perl/bin/* .; -- Steven Lembark 3646 Flora Place Workhorse Computing St. Louis, MO 63110 lembark at wrkhors.com +1 888 359 3508