tag:blogger.com,1999:blog-27488238.post8969037111727694265..comments2024-03-22T11:34:45.165+01:00Comments on taw's blog: What is all this Perl doing in my Ruby?tawhttp://www.blogger.com/profile/16972845140253292628noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-27488238.post-61546387779711808792010-02-09T04:54:03.131+01:002010-02-09T04:54:03.131+01:00Too late because of backwards compatibility. Use o...Too late because of backwards compatibility. Use open3 and check for stderr.<br /><br />But, at the end of the day, if you're using system calls in your code, you have almost certainly screwed up. Always use an API when possible. Always.Daniel Bergerhttps://www.blogger.com/profile/05224445093970941579noreply@blogger.comtag:blogger.com,1999:blog-27488238.post-12691783413388595732010-02-06T05:11:38.016+01:002010-02-06T05:11:38.016+01:00And as of 5.10.1, even Perl has a way to fix this ...And as of 5.10.1, even Perl has a way to fix this sort of problem in core.<br /><br />http://search.cpan.org/~pjf/autodie-2.06/lib/autodie.pm<br /><br />It's not a perfect solution, but it's a heck of a lot better than not having it.Jessehttps://www.blogger.com/profile/17878385795242911118noreply@blogger.comtag:blogger.com,1999:blog-27488238.post-70843113320345572942010-02-06T01:57:22.982+01:002010-02-06T01:57:22.982+01:00Daniel Berger: Why is it really too late? I only w...Daniel Berger: Why is it really too late? I only want the heuristic to correctly print error message if things go wrong, to better match what shell does.<br /><br />It shouldn't break anything - it's more an ancient bug than a change request.tawhttps://www.blogger.com/profile/16972845140253292628noreply@blogger.comtag:blogger.com,1999:blog-27488238.post-23474565253484903892010-02-06T00:47:08.776+01:002010-02-06T00:47:08.776+01:00Too late. Way too late. There's always the ...Too late. Way too late. There's always the 'shell' library. It's closer to what you want, and it's part of the Ruby stdlib, at least for 1.8.x. I haven't checked 1.9.x.Daniel Bergerhttps://www.blogger.com/profile/05224445093970941579noreply@blogger.comtag:blogger.com,1999:blog-27488238.post-49972395103272322292010-02-05T23:00:22.695+01:002010-02-05T23:00:22.695+01:00I submitted it here, maybe they'll fix it: htt...I submitted it here, maybe they'll fix it: http://redmine.ruby-lang.org/issues/show/2715<br /><br />It's not terribly complex problem once you get pass #ifdefs to handle weird operating systems - I think it would be enough if rb_proc_exec in process.c checked return value from execl and print error message if it gets ENOENT, but obviously if would be nicer if someone did the patch for me ;-ptawhttps://www.blogger.com/profile/16972845140253292628noreply@blogger.comtag:blogger.com,1999:blog-27488238.post-27379633769671481132010-02-05T22:51:28.682+01:002010-02-05T22:51:28.682+01:00Can't you just monkey-patch the offending Ruby...Can't you just monkey-patch the offending Ruby libraries locally, then hope you never forget to re-patch them after a new version of Ruby comes out. :-)Keith Saderhttps://www.blogger.com/profile/09145968553823653526noreply@blogger.com