At 1:44 PM -0700 4/10/02, Rasoul Hajikhani wrote: >Folks, >The Apache::File man pages indicate that > >($name,$fh) = Apache::File->tmpfile; > >returns a fh ready to write to. So far so good. > >In case of wanting to read from it, here is what I do: > ># Is this necessary? >$fh->close() or die "Could not close $name: $!\n"; > >$fh->open("<$name"); >local $/ = undef; >$output = <$fh>; >warn "$output\n"; >$fh->close() or die "Could not close $name: $!\n";
To me it appears that you have not written anything to your tmp file... Which would explain the empty $output. Usually temp file creators open in read/write mode. So if you say something like ($name,$fh) = Apache::File->tmpfile; print $fh "Hello World"; seek($fh,0,0); my $line = <$fh>; print $line; It should print "Hello World"; Rob -- When I used a Mac, they laughed because I had no command prompt. When I used Linux, they laughed because I had no GUI.