open PROG, "|program" or die "Can't open output pipe to 'program'"; print PROG function(); close PROG; #### my $input = "first line\nsecond line"; open TEMP, '>' "temp$$"; print TEMP $input; close TEMP; my $ouput = `type temp$$|\\vim\\vim63\\xxd.exe`; print $output; unlink "temp$$"; # (tested)