< ^ >

Reading an Excel binary file


    #!/usr/bin/perl -wl

    use strict;
    use Spreadsheet::ParseExcel;

    my $parse_excel = new Spreadsheet::ParseExcel();

    my $workbook = $parse_excel->Parse('parse.xls');

    my($row, $col, $worksheet, $cell);


    for my $worksheet (@{$workbook->{Worksheet}}) {
        if (defined $worksheet->{MaxRow}) {
            for (my $row =  $worksheet->{MinRow};
                    $row <= $worksheet->{MaxRow};
                    $row++)
            {
                 if (defined $worksheet->{MaxCol}) {
                    for (my $col =  $worksheet->{MinCol};
                            $col <= $worksheet->{MaxCol};
                            $col++)
                    {
                        $cell = $worksheet->{Cells}[$row][$col];
                        print $cell->Value();
                    }
                }
            }
        }
    }

    __END__