Tie::Handle::HTTP - Tie class for doing HTTP range requests for read calls.
use Tie::Handle::HTTP; tie *HANDLE, "http://example.com/largefile"; # or my $fh = Tie::Handle::HTTP->new( "http://example.com/largefile" ); # Seek to 1 MB in the file seek HANDLE, 1024 * 1024, 0; # Read 1 KB from the middle read HANDLE, my $buf, 1024;
This module sets up a tied filehandle and associates it with a single HTTP address where each read on the filehandle will be performed as an HTTP Range request. Keepalives are used when possible, but requests will not be buffered in any way.
Takes a single argument, a URI string to open. Returns a globref for a tied filehandle in this class.
Example code can be found in the 'examples' directory found in the tarball for this module. Fresh copies can be downloaded from CPAN if you are unable to find the examples in a vendor distribution.
No buffering of any kind, may be added in future versions based on demand.
Scalar filehandle manipulation is not supported at this time, I'm not quite sure how to make it work.
Jonathan Steinert, <email@example.com>
Copyright (C) 2006 by Six Apart, Ltd.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.