in reply to Reading from a filehandle written to by a subroutine?

If your on 5.8.x, then you should be able to use a "memory file". See perlfunc:open/perlopentut.

open my $memFH, '+>', \my $buffer; $object->cat( $memFH, $target ); while( <$fh> ) { ## do something with it } # Or $buffer =~ s[...][...]mg; #etc

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?

Replies are listed 'Best First'.
Re^2: Reading from a filehandle written to by a subroutine?
by gclef (Initiate) on Mar 17, 2005 at 17:41 UTC
    Thanks for the pointers. A bit of background, since I wasn't terribly clear:

    I'm trying to get info out of a Subversion repository, using the Subversion perl bindings. One of those modules has a method (cat) where you specify the a target (including a revision number), and it writes that version of the file to a filehandle you give it. So, there's no file for me to open, but I need to be able to read from the resulting filehandle to get back the file from the repository.

    The Memory file seems like a promising tack to take, I'll try that.

    Thanks.