http://www.perlmonks.org?node_id=11777


in reply to Bad file description for win32/bash/perl combo

Too many files!

Well, I may not have answered the question, but I have found that even putting too large of a string into a backtick operation causes the 'Bad file descriptor' error.

`wc $lots_of_files`;
does not work. It can be broken up so to be made to work:
@lots_of_files = split($lots_of_files);

$third = $#lots_of_files;

$a = join(' ', @lots_of_files [0..$third] );

$a = join(' ', @lots_of_files [1+$third..2*third]);

$a = join(' ', @lots_of_files [1+2*$third..$#lots_of_files] );

`wc $a`;

`wc $b`;

`wc $c`;

Well, that seems to work. It doesn't explain why redirection is failing for me in just about all cases though.

Maybe this is usefull to someone.

-coyo