Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Retrieving a file on the web (NOT so easy)

by voyager (Friar)
on Jul 11, 2001 at 08:20 UTC ( [id://95598]=note: print w/replies, xml ) Need Help??


in reply to Retrieving a file on the web (NOT so easy)

When I point my browser (MS/IE5.5) to the URL, I see it fine; the first few lines are:
Content: Planetarion galaxy listing (sorted by x, y) Author: vish@planetarion.com Version: 1.00 (2000-11-20 17:35:00 ISO) Date: 2001-07-11 05:07:01 ISO Separator: ' ' Format: X Y GalaxyName Score 1 1 [BLADE]NoPACrew[Xeno][Legion] 70995861 1 2 -=The [CRUSADE]rs=- [TPB][AC] 62489813 1 3 {gods unwanted children} 10634982 1 4 Realm of Exile {Aesir} {BSun} 42432856 1 5 [p5a] [wl] [VA]- Wolves Lair 77182991 1 6 [Trash] [6thR] Fight Club 53804931
When I run the following:
#! /perl/bin/perl -w use strict; BEGIN { use CGI::Carp qw(fatalsToBrowser warningsToBrowser); } use LWP::Simple; use CGI; $| = 1; my $q = CGI->new; my $URL = "http://cpaweb01.planetarion.com/botfiles/galaxy_listing.gz" +; my $html = get( $URL ); print $q->header, $q->start_html; print $q->h1('Test'); print $html; print $q->end_html;
I see (first few lines):
Test < ÎK; tý]?#Y·&?]GÿS]gFoWÕ>
So my guess (.gz, after all) is that it's a compressed file, which IE can unzip properly but it's just junk to Perl. Perhaps some other monks can help out with a Perl module to deal with compressed files.

Update Masem 2001-07-11 : Changed PRE to CODE

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://95598]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-23 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found