Help for this page

Select Code to Download


  1. or download this
    my $output = `command <<EOF;
    yes
    ...
    
    # print output from `command` after giving it 'yes' as input
    print $output . "\n";
    
  2. or download this
    open(COMMAND, '| command') or die("Can't run command: $!\n");
    
    #  give program 'yes' as input
    print COMMAND 'yes';