Executing program with Perl script but needs user input

Hello,

I'm running a perl script to execute a program through my Unix command line. The program requires a user input but I want to automatically have perl input the string. Is there a way to do this?

Thanks

Use the 3-option version of open, eg

open my $cat, '|-', 'cat' or die "Can't start cat: $!";
print $cat 'Test';
close $cat;