use strict; use warnings; use Sys::Cmd 'spawn'; my $proc = spawn( 'file-not-found' } ); $proc->stdin->print("x\n"); $proc->wait_child;