Help for this page

Select Code to Download


  1. or download this
    my $extcmd = 'cat';
    open my $cmd_pipe, '|-', $extcmd or die "open $extcmd: $!";
    print $cmd_pipe "password\n";
    close $cmd_pipe or die "close $extcmd: ".($! ? $! : "\$?=$?");
    
  2. or download this
    use IPC::Run3 'run3';
    my $stdin = "password\n";
    ...
    $? and die "run3: \$?=$?";
    print "stdout: <<$stdout>>\n";
    print "stderr: <<$stderr>>\n";