I want to retrieve an excel spreadsheet (eventually several at different locations) and display the contents in a web page. if I copy the file locally ive got everything working as expected.I cant retrieve the file and do the same though.

if i do this with a local file it works
#!/usr/bin/perl -w use strict; use warnings; use Spreadsheet::ParseExcel; use DateTime::Format::Excel; use Data::Dumper; use Date::Manip; use Statistics::Descriptive::Discrete ; use Storable; use LWP::Simple; use CGI; my $q = new CGI; print $q->header; print $q->start_html();# $file='/tmp/data.xls'; die "Couldn't get excel file " unless defined $file; my $cell;my $row;my $sheet;my $col;my $excel; $excel = Spreadsheet::ParseExcel::Workbook->Parse($file) or die ("cant + open file"); etc etc
if i do this it doesnt display
#!/usr/bin/perl -w use strict; use warnings; use Spreadsheet::ParseExcel; use DateTime::Format::Excel; use Data::Dumper; use Date::Manip; use Storable; use LWP::Simple; use CGI; my $q = new CGI; print $q->header; print $q->start_html();# my $url = "http://intranet/data.xls"; my $file =get $url; die "Couldn't get excel file " unless defined $file; my $cell;my $row;my $sheet;my $col;my $excel; $excel = Spreadsheet::ParseExcel::Workbook->Parse($file) or die ("cant + open file");
if i dump the retrieved excel object i get this
my $url = "http://intranet/data.xls"; my $file; $file = get $url; die "Couldn't get excel file " unless defined $file; my $cell;my $row;my $sheet;my $col;my $excel; $excel = Spreadsheet::ParseExcel::Workbook->Parse($file) or die ("cant + open file"); print Dumper($excel); $VAR1 = { '_Excel' => bless( { 'FuncTbl' => { '1030' => sub { "DUMMY" +}, '67' => sub { "DUMMY" }, '519' => sub { "DUMMY" } +, '21' => sub { "DUMMY" }, '549' => sub { "DUMMY" } +, '26' => sub { "DUMMY" }, '129' => sub { "DUMMY" } +, '638' => sub { "DUMMY" } +, '520' => sub { "DUMMY" } +, '521' => sub { "DUMMY" } +, '125' => sub { "DUMMY" } +, '27' => sub { "DUMMY" }, '252' => sub { "DUMMY" } +, '190' => sub { "DUMMY" } +, '161' => sub { "DUMMY" } +, '40' => sub { "DUMMY" }, '517' => sub { "DUMMY" } +, '20' => sub { "DUMMY" }, '92' => sub { "DUMMY" }, '545' => sub { "DUMMY" } +, '49' => sub { "DUMMY" }, '24' => sub { "DUMMY" }, '224' => $VAR1->{'_Excel +'}{'FuncTbl'}{'67'}, '516' => sub { "DUMMY" } +, '131' => sub { "DUMMY" } +, '189' => sub { "DUMMY" } +, '2057' => $VAR1->{'_Exce +l'}{'FuncTbl'}{'521'}, --More--Use of uninitialized value in concatenation (.) or string at ( +eval 921) line 15. '42' => sub { "DUMMY" }, '514' => sub { "DUMMY" } +, '214' => sub { "DUMMY" } +, '133' => sub { "DUMMY" } +, '513' => sub { "DUMMY" } +, '515' => sub { "DUMMY" } +, '126' => $VAR1->{'_Excel +'}{'FuncTbl'}{'638'}, '6' => $VAR1->{'_Excel'} +{'FuncTbl'}{'1030'}, '39' => $VAR1->{'_Excel' +}{'FuncTbl'}{'40'}, '85' => sub { "DUMMY" }, '253' => sub { "DUMMY" } +, '146' => sub { "DUMMY" } +, '561' => $VAR1->{'_Excel +'}{'FuncTbl'}{'49'}, '9' => $VAR1->{'_Excel'} +{'FuncTbl'}{'521'}, '41' => $VAR1->{'_Excel' +}{'FuncTbl'}{'40'}, '153' => sub { "DUMMY" } +, '1054' => sub { "DUMMY" +}, '38' => $VAR1->{'_Excel' +}{'FuncTbl'}{'40'}, '60' => sub { "DUMMY" }, '34' => sub { "DUMMY" }, '229' => sub { "DUMMY" } +, '132' => sub { "DUMMY" } +, '43' => sub { "DUMMY" }, '1033' => $VAR1->{'_Exce +l'}{'FuncTbl'}{'521'} }, 'GetContent' => sub { "DUMMY" } }, 'Spreadsheet::ParseExcel' ) };

so how do i get the excel file ?


In reply to retrieving xls file with wget doesnt by medalto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.