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.
In reply to HTTP::Response and Spreadsheet::ParseExcel by jarp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |