in reply to Re^2: Calling strace -f
in thread Diagnosing blocking io (or: finding the WHY of my Open2 woes).

So the solution is to not read from STDIN. Pass a file name instead of the file contents.

BEGIN { my %escapes = ( "\\" => "\\\\", "\"" => "\\\"", "\n" => "\\n", "\r" => "\\r", "\t" => "\\t", ); my ($escapes) = map qr/[$_]/, join '', map quotemeta, keys %escapes; sub to_js_str_literal { for (my $s = $_[0]) { s/($escapes)/$escapes{$1}/g; s/([^\x20-\x7E])/sprintf("\\u%04X", ord($1))/eg; return qq{"$_"}; } } }
my $js_script_qfn = to_js_str_literal($script_qfn); print $JSWRITE <<"__END__"; var filename = $js_script_qfn; load('jslint.js'); END __END__

Well, don't know if scoping allows that exactly, but you get the idea.

Update: I suppose you could pass the file contents in the same manner.

print $JSWRITE map "$_\n", "var file = [", ( map " ".to_js_str_literal($_), <$fh> ), "];", "load('jslint.js');", "END";