more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks BrowserUk, corion and sundialsvc4 for the interesting discussion! (I can not follow all the implementation details.) The discussion has made me aware of that there are many things to consider to write portable Perl code. Portability issues are dealt with in separate documents or sections and this make programmers working on the reference platform (Unix/Linux) less aware of problems in other platforms. PROPOSAL To add information about portability issues in the "Alphabetical Listing of Perl Functions" in perlfunc. This can be done by at the end of function descriptions adding links to the the corresponding entry in "Alphabetical Listing of Perl Functions" in perlport. UNPREDICTABLE RESULT OF KILL ON PSEUDO-PROCESS Observations 1) This always blocks in Windows 7, but not on Windows 2000: perl -e "if ($pid=fork){kill(9, $pid);} else {sleep 1000 }"2) This sometimes blocks and sometimes gives the wrong exit value 9 in Windows 7: perl -e "if ($pid=fork){Win32::Sleep(0); kill(9, $pid);} else {sleep 1000}"3) Running this batch file a number of times on Windows 7:
gave the results:
4) The installations of module on Windows 7 using install in cpan frequently hangs in the tests. Conclusions and implications A better way to inform about the problem? I tried to describe the problems above with:
My intention was do describe the consequence of the implementation (as opposed to describe the implementation and forcing the Perl programmer to draw the conclusions). How can this be stated in a better way? CAN WARNINGS BE USED TO IMPROVE PORTABILITY? A way to support creation of more portable code could be to extend the "Perl Lexical Warnings" system, with optional warnings given when non portable Perl functions (and other non portable constructs) are used. Is this a feasible way to go?OBSERVATIONS and OTHER THOUGHS The discussion indicates that to write good Perl code you need to know Perl, the implementation of Perl and the underlying operating system. To write portable Perl code you need also to know the Perl implementation in all used platforms and in the underlying operating systems. This puts very high demands on Perl programmers supposed to create portable modules and programs! How is portability solved in Python and other dynamic languages? Can "Perl" learn something? In reply to Re: Proposal how to make modules using fork more portable
by Anonymous Monk
|
|