Re: Libwww suggestions

Jack Shirazi - BIU (js@bison.lif.icnet.uk)
Fri, 26 Aug 94 10:54:39 BST


> I've been thinking about what will solve my problem - and I
> think the best way to solve it is to have a request-like
> routine return the filehandle, and read it in 1k blocks,
> resetting the alarm after each read.  I haven't written this
> up yet - and I'm not sure of the best way to return the filehandle.
> 
> How do you pass a pointer to the filehandle?
> You could convert it into integer with $fh=fileno(FH) and the caller
> could re-open it with open(FH,">&$fh") ... Eventually I'll want to
> plug in a status routine so I can show the user % transferred..

Usually you don't return a filehandle. You pass it as an argument.

sub foo {
    local($filehandle) = @_;
    local($package) = caller;
    if ($filehandle eq '') {die "Socket name cannot be nil\n";}
    if ($filehandle !~ /'/) {$socket = "$package'$socket";}
}

&foo(MY_SOCKET).