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)