in reply to Passing Data Between Perl Programs

It might be best to look into piping, thats seems to be what you are looking for.