in reply to Retrieving a file on the web (NOT so easy)
% lynx --source 'http://cpaweb01.planetarion.com/botfiles/galaxy_listing.gz' | lessSo it looks like it is a text file, but it is in fact compressed. Hence, the .gz extension, which is usually a dead giveaway. This means that use of LWP::Simple is going to cause trouble. This is because you will get the raw GZIP file. What I did was:
You can do something like:use LWP::Simple; $content = get ("http://cpaweb01.planetarion.com/botfiles/galaxy_listi +ng.gz"); print $content;
% perl test_get | gunzip -dc | lessA better solution would be to use the gzip compression library module, or use it externally through backticks or a pipe call.
|
---|