in reply to Spreadsheet::Read Open File from the cloud

You will have to perform the additional step of downloading the file first. This is easy using HTTP::Tiny or LWP::UserAgent:

#!perl use strict; use warnings; use HTTP::Tiny; use Spreadsheet::Read; # Fetch data and return a filehandle to that data sub fetch_url { my( $url ) = @_; my $ua = HTTP::Tiny->new; my $res = $ua->get( $url ); open my $fh, '<', \$res->{content}; return $fh } my $fh = fetch_url('http://example.com/example.ods'); my $sheet = Spreadsheet::Read->new( $fh, parser => 'ods' );

Replies are listed 'Best First'.
Re^2: Spreadsheet::Read Open File from the cloud
by vitoco (Hermit) on Oct 01, 2019 at 14:09 UTC

    Thanks, it is a very nice piece of code, but it failed as I suspected, because referenced module Spreadsheet::ReadSXC does not support streams. I got this error:

    Sorry, references as input are not (yet) supported by Spreadsheet::ReadSXC at C:\Temp\read-ods.pl line 22.

    Anyway, I could save to a temp file (actually mirrored) and then used it as it previously did.

      The underlying parser may require a path to an actual file (as opposed to a file handle). parser => 'ods' is such a parser. So create one!