in reply to pretending that the contents of a variable are files

If your other program can read STDIN and write to STDOUT, you can construct a data pump by forking twice (this particular code is from memory and therefore untested, but it's something like this):
defined(my $kid = open RESULT, "-|") or die "fork: $!"; unless ($kid) { # kid does: defined(my $grandkid = open PUMP, "-|") or die "child fork: $!"; unless ($grandkid) { # grandkid does: print @LotsOfDataHere; exit 0; } open STDIN, "<&PUMP" or die "Cannot dup PUMP to STDIN: $!"; exec "anotherprogram"; die "exec anotherprogram: $!"; } while (<RESULT>) { # process the large result ... }
This is effectively setting up the pipeline of "some_perl_widget | anotherprogram | your_program", but from within the program itself.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.