open(VIRTUALPRN, "| perl print.pl"); #### print VIRTUALPRN "foobar\n" #### select VIRTUALPRN; # make this the "default" output handle $|++; # disable output buffering on this handle #### use FileHandle; ... my $VirtualPrnFH = new FileHandle; $VirtualPrnFH->open( "| perl print.pl" ); $VirtualPrnFH->autoflush(1); # turn off buffering ... print $VirtualPrnFH "foobar\n"; ...