passing $fd as a reference



Hi everybody,

below is a few lines from http::daemon pod:

--
$c->send_file( $filename )
$c->send_file( $fd )

Copy the file to the client. The file can be a string (which will be
interpreted as a filename) or a reference to an IO::Handle or glob.
--

I have to admit I have never read file contents by IO::Handle

I usually go about it by:

my $song = 'song.mp3';
open my $fh1, '<', $song or die "open(): $!\n";
binmode $fh1;
close($fh1);

how can I tie the code above to $c->send_file( $fd ) ???

--

btw, when reading a binary file in order to move cursor position, do you
think I should use "seek" or "sysseek" and the should I use read the
file by "read" or "sysread" ??

thanks ever so much!
.



Relevant Pages

  • Re: passing $fd as a reference
    ... In article, Larry ... below is a few lines from http::daemon pod: ... Copy the file to the client. ... The file can be a string (which will be ...
    (comp.lang.perl.misc)
  • Previously Functioning Date Interpreter Now Failing
    ... Dim Entry As String ... Dim Result As String ... Dim ClientElement As Variant 'Holds the extracted Client Number ... ElseIf IsNumeric= False _ ...
    (microsoft.public.excel.programming)
  • RE: Previously Functioning Date Interpreter Now Failing
    ... Dim Entry As String ... Dim Result As String ... Dim ClientElement As Variant 'Holds the extracted Client Number ... ElseIf IsNumeric= False _ ...
    (microsoft.public.excel.programming)
  • Re: Threading a server
    ... I am getting myself into a really big hole with this and the client is a little upset. ... private TcpListener tcpListener; ... private string CurrentCommand ... public string ExpectedSubject ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: WSE2005: Protection requirements in MutualCertificate11Asserti
    ... error when there is a algorithm mismatch between the client and the ... The Web service is using different security requeriments. ... my client, the response page is a browser page ... message, String messageContentType) ...
    (microsoft.public.dotnet.framework.webservices.enhancements)