open PROG, "|program" or die "Can't open output pipe to 'program'"; print PROG function(); close PROG;