jarp has asked for the wisdom of the Perl Monks concerning the following question:
I've pulled an Excel spreadsheet off a website using the following snippet:
Which seems to work just fine, I get 9000+ bytes back, and $CONTENT is definitely binary.my $EXCEL = new Spreadsheet::ParseExcel; my $URL = "http://www.sysco.com/supplier/DUNS%20Listing.xls"; my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new(GET => $URL); my $response = $ua->request($req); if ( $response->is_error() ) { printf " %s\n", $response->status_line; } else { my $CONTENT = $response->content();<br> my $BYTES = length $CONTENT;<br> print "$URL successfully retrieved! [$BYTES] bytes...\n"; }
Now, the problem.
I'm trying to parse $CONTENT, using the Spreadsheet::Excel module, as I need to get to a couple of the columns in the xls file.
How do I do this? I've never dealt with writing binary files, and can't seem to trick the $EXCEL->Parse('some_xls_file') statement into using $CONTENT.
What's the best way to accomplish this?
Any help is appreciated.
Edit, BazB: added code tags, reformatted slightly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTTP::Response and Spreadsheet::ParseExcel
by dragonchild (Archbishop) on Oct 15, 2003 at 20:08 UTC | |
|
Re: HTTP::Response and Spreadsheet::ParseExcel
by snax (Hermit) on Oct 15, 2003 at 20:28 UTC | |
by jarp (Novice) on Oct 15, 2003 at 20:58 UTC | |
by vek (Prior) on Oct 15, 2003 at 23:30 UTC | |
by jarp (Novice) on Oct 16, 2003 at 13:14 UTC |