perl: get a new file descriptor to redirect stdin to -


        $exe = filehandle->new;         $fd = 3; # <-------- doest work         open $exe, q{-|},             "$myexe make 2>&1 <%=$fd"             or die('cannot open exe');         $err = !(close $exe); 

i redirect stdin dummy file descriptor (preferably not having open file).

any suggestions how do after 2>&1 redirect stdin?

2>&1    # dups fd 1 onto fd 2 

so

0<&3    # dups fd 3 onto fd 0 <&3     # "<" affects fd 0 default 

so

open(my $from_child, '-|', "foo 2>&1 <&$fd") 

i can't wonder why want this. part of done better using ipc::run3 or ipc::run?


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -